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 |
||
---|---|---|
.. | ||
astencode.rs | ||
Cargo.toml | ||
creader.rs | ||
csearch.rs | ||
cstore.rs | ||
decoder.rs | ||
diagnostics.rs | ||
encoder.rs | ||
index_builder.rs | ||
index.rs | ||
lib.rs | ||
loader.rs | ||
macro_import.rs | ||
schema.rs |