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