Skip to content
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 for $crate var normalization in proc macro for externally defined macros #51519

Merged
merged 3 commits into from
Jun 12, 2018

Conversation

ExpHP
Copy link
Contributor

@ExpHP ExpHP commented Jun 12, 2018

Fixes #51331, a bug that has existed in at least some form for a year and a half.

The PR includes the addition of a fold_qpath method to syntax::fold::Folder. Overriding this method is useful for folds that modify paths in a way that invalidates indices (insertion or removal of a component), as it provides the opportunity to update qself.position in <A as B>::C paths. I added it because the bugfix is messy without it.

(unfortunately, grepping around the codebase, I did not see anything else that could use it.)

@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 12, 2018
@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jun 12, 2018

📌 Commit d13bfd2 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 12, 2018
@bors
Copy link
Contributor

bors commented Jun 12, 2018

⌛ Testing commit d13bfd2 with merge ef8cb40...

bors added a commit that referenced this pull request Jun 12, 2018
Fix for $crate var normalization in proc macro for externally defined macros

Fixes #51331, a bug that has existed in at least *some* form for a year and a half.

The PR includes the addition of a `fold_qpath` method to `syntax::fold::Folder`.  Overriding this method is useful for folds that modify paths in a way that invalidates indices (insertion or removal of a component), as it provides the opportunity to update `qself.position` in `<A as B>::C` paths.  I added it because the bugfix is messy without it.

(unfortunately, grepping around the codebase, I did not see anything else that could use it.)
@bors
Copy link
Contributor

bors commented Jun 12, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing ef8cb40 to master...

@bors bors merged commit d13bfd2 into rust-lang:master Jun 12, 2018
@ExpHP ExpHP deleted the issue-51331-b branch June 12, 2018 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing tokens in custom derive input generated by macro
5 participants