Uh oh!
There was an error while loading. Please reload this page.
Support #[macro_use] on macro-expanded crates - #34032
Merged
Merged
Conversation
jseyfried
commented
Jun 2, 2016
ContributorAuthor
cc @durka |
jseyfriedforce-pushed
the
load_macros_in_expansion
branch
from
June 3, 2016 12:59
1b05450 to
38166c8CompareContributor
There was a problem hiding this comment.
Huh? Why 2? This probably needs a comment. :d
LeoTestard
commented
Jun 4, 2016
Contributor
(Otherwise: 👍 💯) |
jseyfriedforce-pushed
the
load_macros_in_expansion
branch
from
June 5, 2016 02:18
f953a79 to
acbff87Comparenrc
commented
Jun 7, 2016
Member
@bors: r+ |
bors
commented
Jun 7, 2016
Collaborator
📌 Commit acbff87 has been approved by |
bors
commented
Jun 8, 2016
Collaborator
🔒 Merge conflict |
bors
commented
Jun 8, 2016
Collaborator
☔ The latest upstream changes (presumably #34010) made this pull request unmergeable. Please resolve the merge conflicts. |
jseyfriedforce-pushed
the
load_macros_in_expansion
branch
from
June 9, 2016 00:50
acbff87 to
dbf0326Comparejseyfried
commented
Jun 9, 2016
ContributorAuthor
Rebased. @bors r=nrc |
bors
commented
Jun 9, 2016
Collaborator
📌 Commit dbf0326 has been approved by |
bors
commented
Jun 9, 2016
Collaborator
bors added a commit
that referenced
this pull request
Jun 9, 2016
Support `#[macro_use]` on macro-expanded crates This PR loads macros from `#[macro_use]` crates during expansion so that - macro-expanded `#[macro_use]` crates work (fixes#33936, fixes#28071), and - macros imported from crates have the same scope as macros imported from modules. This is a [breaking-change]. For example, this will break: ```rust macro_rules! m { () => { #[macro_use(foo)] extern crate core; } //~ ERROR imported macro not found } m!(); ``` Also, this will break: ```rust macro_rules! try { () => {} } // #[macro_use] mod bar { macro_rules! try { ... } } //< ... just like this would ... fn main() { try!(); } //< ... making this an error ``` r? @nrc
bors
commented
Jun 9, 2016
Collaborator
jseyfried
commented
Jun 10, 2016
ContributorAuthor
alexcrichton
commented
Jun 10, 2016
Member
Added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR loads macros from
#[macro_use]crates during expansion so that#[macro_use]crates work (fixes#[macro_use]does not work on macro-expandedextern crates #33936, fixesinclude!ed files are unable to #[macro_use] #28071), andmacros imported from crates have the same scope as macros imported from modules.(EDIT: reverted in Revert a change in the scope of macros imported from crates to fix a regression #34239)
This is a [breaking-change]. For example, this will break:
Also, this will break:r? @nrc