1 // Test a case where you have an impl of `Foo<X>` for all `X` that
2 // is being applied to `for<'a> Foo<&'a mut X>`. Issue #19730.
5 fn foo(&self, x: X) { }
9 where T : for<'a> Foo<&'a isize>
13 // AnyInt implements Foo<&'a isize> for any 'a, so it is a match.
15 impl<'a> Foo<&'a isize> for AnyInt { }
20 // StaticInt only implements Foo<&'static isize>, so it is an error.
22 impl Foo<&'static isize> for StaticInt { }
24 want_hrtb::<StaticInt>() //~ ERROR
27 // AnyInt implements Foo<&'a isize> for any 'a, so it is a match.
28 impl<'a> Foo<&'a isize> for &'a u32 { }
30 want_hrtb::<&'a u32>() //~ ERROR