Skip to content

Fix for $crate var normalization in proc macro for externally defined macros - #51519

Merged
bors merged 3 commits into
rust-lang:masterfrom
exphp-forks:issue-51331-b
Jun 12, 2018
Merged

Fix for $crate var normalization in proc macro for externally defined macros#51519
bors merged 3 commits into
rust-lang:masterfrom
exphp-forks:issue-51331-b

Conversation

@ExpHP

@ExpHP ExpHP commented Jun 12, 2018

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Thanks!
@bors r+

@bors

bors commented Jun 12, 2018

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Jun 12, 2018

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Jun 12, 2018

Copy link
Copy Markdown
Collaborator

☀️ 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