Files
rust/src/test/ui/lint/bare-trait-objects-path.rs

25 lines
663 B
Rust
Raw Normal View History

#![feature(associated_type_defaults)]
trait Assoc {
fn func() {}
const CONST: u8 = 0;
type Ty = u8;
}
trait Dyn {}
impl Assoc for dyn Dyn {}
fn main() {
2021-04-16 11:06:51 +02:00
Dyn::func();
//~^ WARN trait objects without an explicit `dyn` are deprecated
//~| WARN this was previously accepted by the compiler
::Dyn::func();
//~^ WARN trait objects without an explicit `dyn` are deprecated
//~| WARN this was previously accepted by the compiler
Dyn::CONST;
//~^ WARN trait objects without an explicit `dyn` are deprecated
//~| WARN this was previously accepted by the compiler
let _: Dyn::Ty; //~ ERROR ambiguous associated type
}