-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix a few regressions from enabling macro modularization #53270
Conversation
… gate Feature gate `rustc_` and `derive_` with their own gates again instead of `custom_attribute`
…attribute macro invocations This is needed to avoid regressions on stable channel
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ p=1 |
📌 Commit deca94be202e8c9b406dd0888a67697bd94b984e has been approved by |
🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened |
Thanks for the fixes! |
@bors r- The error order in ---- [ui] ui/imports/local-modularized-tricky-fail-3.rs stdout ----
diff of stderr:
1 error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
- --> $DIR/local-modularized-tricky-fail-3.rs:30:5
+ --> $DIR/local-modularized-tricky-fail-3.rs:25:9
3 |
- LL | ::exported!();
- | ^^^^^^^^^^
+ LL | use exported;
+ | ^^^^^^^^
6 |
7 note: the macro is defined here
8 --> $DIR/local-modularized-tricky-fail-3.rs:17:5
16 | ------------------- in this macro invocation
17
18 error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
- --> $DIR/local-modularized-tricky-fail-3.rs:25:9
+ --> $DIR/local-modularized-tricky-fail-3.rs:30:5
20 |
- LL | use exported;
- | ^^^^^^^^
+ LL | ::exported!();
+ | ^^^^^^^^^^
23 |
24 note: the macro is defined here
25 --> $DIR/local-modularized-tricky-fail-3.rs:17:5 |
|
deca94b
to
dd0a766
Compare
@bors r=alexcrichton |
📌 Commit dd0a766 has been approved by |
⌛ Testing commit dd0a766 with merge b09bfb7aaacdc24e77d2dfc863f07a9c829b8124... |
💔 Test failed - status-travis |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors retry |
⌛ Testing commit dd0a766 with merge 797d2b2bc2630f2ef8f591cf8a6f2d663b9b1b77... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors p=18 |
Fix a few regressions from enabling macro modularization The first commit restores the old behavior for some minor unstable stuff (`rustc_*` and `derive_*` attributes) and adds a new feature gate for arbitrary tokens in non-macro attributes. The second commit fixes #53205 The third commit fixes #53144. Same technique is used as for other things blocking expansion progress - if something causes indeterminacy too often, then prohibit it. In this case referring to crate-local macro-expanded `#[macro_export]` macros via module-relative paths is prohibited, see comments in code for more details. cc #50911
☀️ Test successful - status-appveyor, status-travis |
The added error says "macro-expanded Is it correct that the pattern of re-exporting a macro_rules macro to allow it to be referenced by a module path is deliberately unable to be emitted by a (procedural) macro? (This actually broke the usage of logos lexers defined/derived in the root namespace, which was resolved by removing the need for the helper macro emitted as part of the derive.) |
The first commit restores the old behavior for some minor unstable stuff (
rustc_*
andderive_*
attributes) and adds a new feature gate for arbitrary tokens in non-macro attributes.The second commit fixes #53205
The third commit fixes #53144.
Same technique is used as for other things blocking expansion progress - if something causes indeterminacy too often, then prohibit it.
In this case referring to crate-local macro-expanded
#[macro_export]
macros via module-relative paths is prohibited, see comments in code for more details.cc #50911