]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-74816.rs
Rollup merge of #94019 - hermitcore:target, r=Mark-Simulacrum
[rust.git] / src / test / ui / generic-associated-types / issue-74816.rs
1 #![feature(associated_type_defaults)]
2 #![feature(generic_associated_types)]
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 }