]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-74816.rs
Rollup merge of #102854 - semarie:openbsd-immutablestack, r=m-ou-se
[rust.git] / src / test / ui / generic-associated-types / issue-74816.rs
1 #![feature(associated_type_defaults)]
2
3 trait Trait1 {
4     fn foo();
5 }
6
7 trait Trait2 {
8     type Associated: Trait1 = Self;
9     //~^ ERROR: the trait bound `Self: Trait1` is not satisfied
10     //~| the size for values of type `Self` cannot be known
11 }
12
13 impl Trait2 for () {}
14
15 fn call_foo<T: Trait2>() {
16     T::Associated::foo()
17 }
18
19 fn main() {
20     call_foo::<()>()
21 }