rust/src/libsyntax_ext
bors f3745653e1 Auto merge of #36767 - jseyfried:enforce_rfc_1560_shadowing, r=nrc
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
2016-10-03 01:30:32 -07:00
..
deriving Rollup merge of #34764 - pnkfelix:attrs-on-generic-formals, r=eddyb 2016-10-01 19:22:39 +05:30
asm.rs make emit_feature_err take a ParseSess 2016-09-26 07:07:41 +02:00
Cargo.toml rustc: Implement custom derive (macros 1.1) 2016-09-02 12:52:56 -07:00
cfg.rs run rustfmt on libsyntax_ext folder 2016-08-12 09:40:12 +05:30
concat_idents.rs make emit_feature_err take a ParseSess 2016-09-26 07:07:41 +02:00
concat.rs run rustfmt on libsyntax_ext folder 2016-08-12 09:40:12 +05:30
env.rs run rustfmt on libsyntax_ext folder 2016-08-12 09:40:12 +05:30
format.rs libsyntax: clearer names for some AST parts 2016-09-28 22:31:18 +02:00
lib.rs Refactor ext::base::Resolver::add_ext to only define macros in the crate root. 2016-10-02 06:02:47 +00:00
log_syntax.rs make emit_feature_err take a ParseSess 2016-09-26 07:07:41 +02:00
rustc_macro_registrar.rs Differentiate between monotonic and non-monotonic expansion and 2016-09-13 09:40:28 +00:00
trace_macros.rs make emit_feature_err take a ParseSess 2016-09-26 07:07:41 +02:00