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.
17 lines
486 B
Plaintext
17 lines
486 B
Plaintext
error: `#[macro_export]` has no effect on declarative macro definitions
|
|
--> $DIR/macro_export_on_decl_macro.rs:6:1
|
|
|
|
|
LL | #[macro_export]
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= note: declarative macros follow the same exporting rules as regular items
|
|
note: the lint level is defined here
|
|
--> $DIR/macro_export_on_decl_macro.rs:4:9
|
|
|
|
|
LL | #![deny(unused)]
|
|
| ^^^^^^
|
|
= note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]`
|
|
|
|
error: aborting due to previous error
|
|
|