Closed
Description
In the newest nightly all attributes with names identical to existing macros are parsed as macro invocation (note the lack of !
at the front of dummy
in the example below).
Previous version nightly-2018-08-17
works as expected.
This breaks compilation of some of our custom derives, using same name for attributes and macros, which was previously allowed.
I tried this code:
macro_rules! dummy {
($x:expr) => {
println!("dummy: {}", $x)
}
}
#[dummy("text")] // this should not be regarded as a `dummy` macro invocation, should it?
struct SampleStruct {
}
fn main() {
dummy!("text");
}
I expected this to complain about unknown custom attribute dummy
Instead, I got this error:
error: macro `dummy` may not be used in attributes
--> src/main.rs:7:1
|
7 | #[dummy("text")]
| ^^^^^^^^^^^^^^^^
Meta
rustc --version --verbose
:
rustc 1.30.0-nightly (33b923fd4 2018-08-18)
binary: rustc
commit-hash: 33b923fd44c5c5925e635815fce68bdf1f98740f
commit-date: 2018-08-18
host: x86_64-unknown-linux-gnu
release: 1.30.0-nightly
LLVM version: 7.0