Closed
Description
This code:
#![warn(rust_2018_compatibility)]
macro_rules! foo {
() => {
fn _foo() {
let _x: Box<dyn Drop>;
}
}
}
foo!();
when compiled under 2015 edition yields:
warning: `dyn` is a keyword in the 2018 edition
--> src/lib.rs:6:25
|
6 | let _x: Box<dyn Drop>;
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
|
note: lint level defined here
--> src/lib.rs:1:9
|
1 | #![warn(rust_2018_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: #[warn(keyword_idents)] implied by #[warn(rust_2018_compatibility)]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
but the warning and suggestion are incorrect!
First reported at rust-lang/cargo#6359
This also applies to macro invocations