mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
bdf4e3de9c
The compiler should emit a more specific error when the `#[macro_export]` attribute is present on a decl macro, instead of silently ignoring it. This commit adds the required error message in rustc_passes/messages.ftl, as well as a note. A new variant is added to the `errors::MacroExport` enum, specifically for the case where the attribute is added to a macro 2.0.
9 lines
238 B
Rust
9 lines
238 B
Rust
// Using #[macro_export] on a decl macro has no effect and should warn
|
|
|
|
#![feature(decl_macro)]
|
|
#![deny(unused)]
|
|
|
|
#[macro_export] //~ ERROR `#[macro_export]` has no effect on declarative macro definitions
|
|
pub macro foo() {}
|
|
|
|
fn main() {}
|