]> git.proxmox.com Git - rustc.git/blame - src/test/ui/generic-associated-types/issue-74816.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / generic-associated-types / issue-74816.rs
CommitLineData
29967ef6
XL
1#![feature(associated_type_defaults)]
2#![feature(generic_associated_types)]
29967ef6
XL
3
4trait Trait1 {
5 fn foo();
6}
7
8trait 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
14impl Trait2 for () {}
15
16fn call_foo<T: Trait2>() {
17 T::Associated::foo()
18}
19
20fn main() {
21 call_foo::<()>()
22}