]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / 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     let _x: &SomeTrait = todo!();
10     //~^ ERROR trait objects without an explicit `dyn` are deprecated
11     //~| WARN this is accepted in the current edition
12 }
13
14 trait SomeTrait {}
15
16 fn main() {}