f3745653e1
Enforce the shadowing restrictions from RFC 1560 for today's macros This PR enforces a weakened version of the shadowing restrictions from RFC 1560. More specifically, - If a macro expansion contains a `macro_rules!` macro definition that is used outside of the expansion, the defined macro may not shadow an existing macro. - If a macro expansion contains a `#[macro_use] extern crate` macro import that is used outside of the expansion, the imported macro may not shadow an existing macro. This is a [breaking-change]. For example, ```rust macro_rules! m { () => {} } macro_rules! n { () => { macro_rules! m { () => {} } //< This shadows an existing macro. m!(); //< This is inside the expansion that generated `m`'s definition, so it is OK. } } n!(); m!(); //< This use of `m` is outside the expansion, so it causes the shadowing to be an error. ``` r? @nrc |
||
---|---|---|
.. | ||
deriving | ||
asm.rs | ||
Cargo.toml | ||
cfg.rs | ||
concat_idents.rs | ||
concat.rs | ||
env.rs | ||
format.rs | ||
lib.rs | ||
log_syntax.rs | ||
rustc_macro_registrar.rs | ||
trace_macros.rs |