]> git.lizzy.rs Git - rust.git/blob - src/test/ui/default-associated-types.rs
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril
[rust.git] / src / test / ui / default-associated-types.rs
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
16 fn 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 }