]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/unspecified-self-in-trait-ref.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / unspecified-self-in-trait-ref.rs
1 pub trait Foo<A=Self> {
2     fn foo(&self);
3 }
4
5 pub trait Bar<X=usize, A=Self> {
6     fn foo(&self);
7 }
8
9 fn main() {
10     let a = Foo::lol();
11     //~^ ERROR no function or associated item named
12     //~| WARN trait objects without an explicit `dyn` are deprecated
13     //~| WARN this is accepted in the current edition
14     let b = Foo::<_>::lol();
15     //~^ ERROR no function or associated item named
16     //~| WARN trait objects without an explicit `dyn` are deprecated
17     //~| WARN this is accepted in the current edition
18     let c = Bar::lol();
19     //~^ ERROR no function or associated item named
20     //~| WARN trait objects without an explicit `dyn` are deprecated
21     //~| WARN this is accepted in the current edition
22     let d = Bar::<usize, _>::lol();
23     //~^ ERROR no function or associated item named
24     //~| WARN trait objects without an explicit `dyn` are deprecated
25     //~| WARN this is accepted in the current edition
26     let e = Bar::<usize>::lol();
27     //~^ ERROR must be explicitly specified
28     //~| WARN trait objects without an explicit `dyn` are deprecated
29     //~| WARN this is accepted in the current edition
30 }