1 // run-pass 2 3 #![feature(associated_type_defaults)] 4 5 trait Foo<T: Default + ToString> { 6 type Out: Default + ToString = T; 7 } 8 9 impl Foo<u32> for () { 10 } 11 12 impl Foo<u64> for () { 13 type Out = bool; 14 } 15 main()16fn main() { 17 assert_eq!( 18 <() as Foo<u32>>::Out::default().to_string(), 19 "0"); 20 assert_eq!( 21 <() as Foo<u64>>::Out::default().to_string(), 22 "false"); 23 } 24