2015-09-13 14:14:04 -06:00
|
|
|
pub trait Foo<A=Self> {
|
2016-10-27 05:17:42 +03:00
|
|
|
fn foo(&self);
|
2015-09-13 14:14:04 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Bar<X=usize, A=Self> {
|
2016-10-27 05:17:42 +03:00
|
|
|
fn foo(&self);
|
2015-09-13 14:14:04 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a = Foo::lol();
|
2017-06-02 13:20:36 -07:00
|
|
|
//~^ ERROR no function or associated item named
|
2021-07-10 10:00:54 +02:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition
|
2015-09-13 14:14:04 -06:00
|
|
|
let b = Foo::<_>::lol();
|
2017-06-02 13:20:36 -07:00
|
|
|
//~^ ERROR no function or associated item named
|
2021-07-10 10:00:54 +02:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition
|
2015-09-13 14:14:04 -06:00
|
|
|
let c = Bar::lol();
|
2017-06-02 13:20:36 -07:00
|
|
|
//~^ ERROR no function or associated item named
|
2021-07-10 10:00:54 +02:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition
|
2015-09-13 14:14:04 -06:00
|
|
|
let d = Bar::<usize, _>::lol();
|
2017-06-02 13:20:36 -07:00
|
|
|
//~^ ERROR no function or associated item named
|
2021-07-10 10:00:54 +02:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition
|
2015-09-13 21:43:24 -06:00
|
|
|
let e = Bar::<usize>::lol();
|
|
|
|
//~^ ERROR must be explicitly specified
|
2021-07-10 10:00:54 +02:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition
|
2015-09-13 14:14:04 -06:00
|
|
|
}
|