]> git.lizzy.rs Git - rust.git/blob - tests/ui/dyn-keyword/dyn-2018-edition-lint.rs
Move /src/test to /tests
[rust.git] / tests / ui / dyn-keyword / dyn-2018-edition-lint.rs
1 // edition:2018
2 #[deny(bare_trait_objects)]
3
4 fn function(x: &SomeTrait, y: Box<SomeTrait>) {
5     //~^ ERROR trait objects without an explicit `dyn` are deprecated
6     //~| WARN this is accepted in the current edition
7     //~| ERROR trait objects without an explicit `dyn` are deprecated
8     //~| WARN this is accepted in the current edition
9     //~| ERROR trait objects without an explicit `dyn` are deprecated
10     //~| WARN this is accepted in the current edition
11     //~| ERROR trait objects without an explicit `dyn` are deprecated
12     //~| WARN this is accepted in the current edition
13     //~| ERROR trait objects without an explicit `dyn` are deprecated
14     //~| WARN this is accepted in the current edition
15     //~| ERROR trait objects without an explicit `dyn` are deprecated
16     //~| WARN this is accepted in the current edition
17     let _x: &SomeTrait = todo!();
18     //~^ ERROR trait objects without an explicit `dyn` are deprecated
19     //~| WARN this is accepted in the current edition
20 }
21
22 trait SomeTrait {}
23
24 fn main() {}