]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lint/bare-trait-objects-path.rs
New upstream version 1.54.0+dfsg1
[rustc.git] / src / test / ui / lint / bare-trait-objects-path.rs
CommitLineData
6a06907d
XL
1#![feature(associated_type_defaults)]
2
3trait Assoc {
4 fn func() {}
5 const CONST: u8 = 0;
6 type Ty = u8;
7}
8
9trait Dyn {}
10
11impl Assoc for dyn Dyn {}
12
13fn main() {
17df50a5
XL
14 Dyn::func();
15 //~^ WARN trait objects without an explicit `dyn` are deprecated
16 //~| WARN this was previously accepted by the compiler
17 ::Dyn::func();
18 //~^ WARN trait objects without an explicit `dyn` are deprecated
19 //~| WARN this was previously accepted by the compiler
20 Dyn::CONST;
21 //~^ WARN trait objects without an explicit `dyn` are deprecated
22 //~| WARN this was previously accepted by the compiler
6a06907d
XL
23 let _: Dyn::Ty; //~ ERROR ambiguous associated type
24}