]>
Commit | Line | Data |
---|---|---|
416331ca XL |
1 | // run-pass |
2 | ||
62682a34 | 3 | #![feature(associated_type_defaults)] |
85aaf69f | 4 | |
54a0048b SL |
5 | trait Foo<T: Default + ToString> { |
6 | type Out: Default + ToString = T; | |
62682a34 | 7 | } |
223e47cc | 8 | |
62682a34 | 9 | impl Foo<u32> for () { |
62682a34 SL |
10 | } |
11 | ||
54a0048b SL |
12 | impl Foo<u64> for () { |
13 | type Out = bool; | |
62682a34 SL |
14 | } |
15 | ||
16 | fn main() { | |
54a0048b SL |
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"); | |
62682a34 | 23 | } |