blob: c932025d1178c79787208e1bb34e87270ff9cb60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#![feature(associated_type_defaults)]
#![feature(generic_associated_types)]
trait Trait1 {
fn foo();
}
trait Trait2 {
type Associated: Trait1 = Self;
//~^ ERROR: the trait bound `Self: Trait1` is not satisfied
//~| 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::<()>()
}
|