]>
Commit | Line | Data |
---|---|---|
29967ef6 XL |
1 | #![feature(associated_type_defaults)] |
2 | #![feature(generic_associated_types)] | |
29967ef6 XL |
3 | |
4 | trait Trait1 { | |
5 | fn foo(); | |
6 | } | |
7 | ||
8 | trait Trait2 { | |
9 | type Associated: Trait1 = Self; | |
10 | //~^ ERROR: the trait bound `Self: Trait1` is not satisfied | |
11 | //~| the size for values of type `Self` cannot be known | |
12 | } | |
13 | ||
14 | impl Trait2 for () {} | |
15 | ||
16 | fn call_foo<T: Trait2>() { | |
17 | T::Associated::foo() | |
18 | } | |
19 | ||
20 | fn main() { | |
21 | call_foo::<()>() | |
22 | } |