//@ known-bug: #136666 // Needed so that rust can infer that the A in what() is &() trait IsRef {} struct Dummy; impl<'a> IsRef<&'a ()> for Dummy {} trait WithLifetime { type Output<'a>; } impl<'t> WithLifetime for &'t () { type Output<'a> = &'a (); } // Needed to prevent the two Foo impls from overlapping struct Wrap(A); trait Unimplemented {} trait Foo {} impl Foo for T where T: Unimplemented {} impl Foo for Wrap where Dummy: IsRef, for<'a> A: WithLifetime = A>, { } fn what() where Wrap: Foo, { } fn main() { what(); }