1 // run-pass 2 trait TheTrait : TheSuperTrait<<Self as TheTrait>::Item> { 3 type Item; 4 } 5 6 trait TheSuperTrait<T> { 7 fn get(&self) -> T; 8 } 9 10 impl TheTrait for i32 { 11 type Item = u32; 12 } 13 14 impl TheSuperTrait<u32> for i32 { 15 fn get(&self) -> u32 { 16 *self as u32 17 } 18 } 19 20 fn foo<T:TheTrait<Item=u32>>(t: &T) -> u32 { 21 t.get() 22 } 23 main()24fn main() { 25 foo::<i32>(&22); 26 } 27