rust/tests/ui/dyn-keyword/dyn-2018-edition-lint.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
536 B
Rust
Raw Normal View History

2021-04-13 14:55:54 +00:00
//@ edition:2018
#[deny(bare_trait_objects)]
fn function(x: &SomeTrait, y: Box<SomeTrait>) {
//~^ ERROR 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-13 14:55:54 +00:00
//~| ERROR 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-13 14:55:54 +00:00
let _x: &SomeTrait = todo!();
2021-11-20 10:54:12 +00:00
//~^ ERROR trait objects without an explicit `dyn` are deprecated
//~| WARN this is accepted in the current edition
2021-04-13 14:55:54 +00:00
}
trait SomeTrait {}
fn main() {}