]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/bare-trait-objects-path.rs
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / ui / lint / bare-trait-objects-path.rs
1 #![feature(associated_type_defaults)]
2
3 trait Assoc {
4     fn func() {}
5     const CONST: u8 = 0;
6     type Ty = u8;
7 }
8
9 trait Dyn {}
10
11 impl Assoc for dyn Dyn {}
12
13 fn main() {
14     Dyn::func();
15     //~^ WARN trait objects without an explicit `dyn` are deprecated
16     //~| WARN this is accepted in the current edition
17     ::Dyn::func();
18     //~^ WARN trait objects without an explicit `dyn` are deprecated
19     //~| WARN this is accepted in the current edition
20     Dyn::CONST;
21     //~^ WARN trait objects without an explicit `dyn` are deprecated
22     //~| WARN this is accepted in the current edition
23     let _: Dyn::Ty; //~ ERROR ambiguous associated type
24     //~^ WARN trait objects without an explicit `dyn` are deprecated
25     //~| WARN this is accepted in the current edition
26 }