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