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