]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/issue-74816.rs
Rollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-Simulacrum
[rust.git] / tests / 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 }