]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #37084 - jseyfried:cleanup_expanded_macro_use_scopes, r=nrc
authorAlex Crichton <alex@alexcrichton.com>
Wed, 12 Oct 2016 17:15:28 +0000 (10:15 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 12 Oct 2016 21:07:56 +0000 (14:07 -0700)
commit20991829e2639d1786acbd52621b220c89f0d9cb
treea7ff8a46ca55d95a90fefa785bc59667e94cfc23
parent2d71be5780f2c7548956625d2261d39798f3ce83
parent829bd8c9b9519d7e4f769ad752b5da0ebe60e3ad
Rollup merge of #37084 - jseyfried:cleanup_expanded_macro_use_scopes, r=nrc

macros: clean up scopes of expanded `#[macro_use]` imports

This PR changes the scope of macro-expanded `#[macro_use]` imports to match that of unexpanded `#[macro_use]` imports. For example, this would be allowed:
```rust
example!();
macro_rules! m { () => { #[macro_use(example)] extern crate example_crate; } }
m!();
```

This PR also enforces the full shadowing restrictions from RFC 1560 on `#[macro_use]` imports (currently, we only enforce the weakened restrictions from #36767).

This is a [breaking-change], but I believe it is highly unlikely to cause breakage in practice.
r? @nrc
src/librustc/hir/lowering.rs
src/librustc_resolve/lib.rs
src/librustc_resolve/resolve_imports.rs