]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/default-associated-types.rs
Auto merge of #61361 - estebank:infer-type, r=varkor
[rust.git] / src / test / run-pass / default-associated-types.rs
1 #![feature(associated_type_defaults)]
2
3 trait Foo<T: Default + ToString> {
4     type Out: Default + ToString = T;
5 }
6
7 impl Foo<u32> for () {
8 }
9
10 impl Foo<u64> for () {
11     type Out = bool;
12 }
13
14 fn main() {
15     assert_eq!(
16         <() as Foo<u32>>::Out::default().to_string(),
17         "0");
18     assert_eq!(
19         <() as Foo<u64>>::Out::default().to_string(),
20         "false");
21 }