about summary refs log tree commit diff
path: root/tests/ui/generic-associated-types/issue-74816.rs
blob: 6ec0b3261739ceed6f6ea5f52486eb0d2a82af31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver

#![feature(associated_type_defaults)]

trait Trait1 {
    fn foo();
}

trait Trait2 {
    type Associated: Trait1 = Self;
    //~^ ERROR: the trait bound `Self: Trait1` is not satisfied
    //~| ERROR the size for values of type `Self` cannot be known
}

impl Trait2 for () {}

fn call_foo<T: Trait2>() {
    T::Associated::foo()
}

fn main() {
    call_foo::<()>()
}