-
Couldn't load subscription status.
- Fork 13.9k
macros: clean up scopes of expanded #[macro_use] imports
#37084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macros: clean up scopes of expanded #[macro_use] imports
#37084
Conversation
|
@EddyD, @brson, @nikomatsakis could this get a Crater run please? |
|
Starting crater run now. |
|
Thanks @eddyb! |
|
@bors: r+ |
|
📌 Commit 829bd8c has been approved by |
|
ah crap @bors: r- |
|
r=me if the Crater run comes back clean |
|
The crater report only has crater download failures and such (cc @brson). @bors r=nrc |
|
📌 Commit 829bd8c has been approved by |
…e_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 rust-lang#36767).
This is a [breaking-change], but I believe it is highly unlikely to cause breakage in practice.
r? @nrc
macros: improve shadowing checks This PR improves macro-expanded shadowing checks to work with out-of-(pre)order expansion. Out-of-order expansion became possible in #37084, so this technically a [breaking-change] for nightly. The regression test from this PR is an example of code that would break. r? @nrc
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: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