2021-03-18 00:02:44 +00:00
|
|
|
#![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 09:06:51 +00:00
|
|
|
Dyn::func();
|
|
|
|
//~^ WARN trait objects without an explicit `dyn` are deprecated
|
2021-06-16 12:27:44 +00:00
|
|
|
//~| WARN this is accepted in the current edition
|
2021-04-16 09:06:51 +00:00
|
|
|
::Dyn::func();
|
|
|
|
//~^ WARN trait objects without an explicit `dyn` are deprecated
|
2021-06-16 12:27:44 +00:00
|
|
|
//~| WARN this is accepted in the current edition
|
2021-04-16 09:06:51 +00:00
|
|
|
Dyn::CONST;
|
|
|
|
//~^ WARN trait objects without an explicit `dyn` are deprecated
|
2021-06-16 12:27:44 +00:00
|
|
|
//~| WARN this is accepted in the current edition
|
2021-03-18 00:02:44 +00:00
|
|
|
let _: Dyn::Ty; //~ ERROR ambiguous associated type
|
2021-07-10 08:00:54 +00:00
|
|
|
//~^ WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition
|
2021-03-18 00:02:44 +00:00
|
|
|
}
|