rust/src/librustc_metadata
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
..
astencode.rs rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
Cargo.toml rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
creader.rs Rollup merge of #36794 - japaric:target-panic, r=alexcrichton 2016-09-28 20:21:52 -07:00
csearch.rs add a panic-strategy field to the target specification 2016-09-27 21:26:08 -05:00
cstore.rs add a panic-strategy field to the target specification 2016-09-27 21:26:08 -05:00
decoder.rs rustc_resolve: bring back "struct called like a function" cross-crate. 2016-09-20 20:08:07 +03:00
diagnostics.rs Fix fallout in tests. 2016-09-27 06:43:51 +00:00
encoder.rs Fix RUSTC_VERSION for 'documenting' build stage. 2016-09-30 16:24:50 -06:00
index_builder.rs rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
index.rs rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
lib.rs rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
loader.rs Fix RUSTC_VERSION for 'documenting' build stage. 2016-09-30 16:24:50 -06:00
macro_import.rs Record macro import site spans. 2016-10-02 06:07:49 +00:00
schema.rs Fix RUSTC_VERSION for 'documenting' build stage. 2016-09-30 16:24:50 -06:00