-
Notifications
You must be signed in to change notification settings - Fork 580
Open
Labels
A-macrosArea: MacrosArea: Macros
Description
There seems to be a restriction that macro_use cannot shadow a macro_use macro when expanded from within a macro_rules macro.
#[macro_use(foo)] extern crate m;
macro_rules! m1 { () => {
#[macro_use(foo)] //~ ERROR `foo` is already in scope
extern crate m as _;
}}
m1!();emits:
error: `foo` is already in scope
╭▸ src/lib.rs:4:17
│
4 │ #[macro_use(foo)] //~ ERROR `foo` is already in scope
│ ━━━
‡
7 │ m1!();
│ ───── in this macro invocation
│
├ note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560)
╰ note: this error originates in the macro `m1` (in Nightly builds, run with -Z macro-backtrace for more info)
I couldn't find a rule (or combination of rules) that would cover this situation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-macrosArea: MacrosArea: Macros
Type
Fields
Give feedbackNo fields configured for issues without a type.