1 // check-pass 2 3 #![feature(generic_associated_types)] 4 5 6 trait Fun { 7 type F<'a>; 8 identity<'a>(t: Self::F<'a>) -> Self::F<'a>9 fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t } 10 } 11 12 impl <T> Fun for T { 13 type F<'a> = Self; 14 } 15 bug<'a, T: for<'b> Fun<F<'b> = T>>(t: T) -> T::F<'a>16fn bug<'a, T: for<'b> Fun<F<'b> = T>>(t: T) -> T::F<'a> { 17 T::identity(t) 18 } 19 20 main()21fn main() { 22 let x = 10; 23 24 bug(x); 25 } 26