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: derive source scope from syntax node to be transformed #14989
fix: derive source scope from syntax node to be transformed #14989
Conversation
ea7bc2d
to
7df5768
Compare
So that was the problem |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
7df5768
to
d091991
Compare
@bors r=Veykril |
☀️ Test successful - checks-actions |
…nicola minor: remove commented out conflicts Follow-up to #14989 🤦♂️
Fixes #14534
When we use
PathTransform
for associated items of a trait, we have been feedingSemanticsScope
for the trait definition to it as source scope.PathTransform
uses the source scope to resolve paths in associated items to find which path to transform. In the course of path resolution, the scope is responsible for loweringast::MacroType
s (because they can be written within a path) usingAstIdMap
for the scope'sHirFileId
.The problem here is that when an associated item is generated by a macro, the scope for the trait is different from the scope for that associated item. The former can only resolve the top-level macros within the trait definition but not the macro calls generated by those top-level macros. We need the latter to resolve such nested macros.
This PR makes sure that we pass
SemanticsScope
for each associated item we're applying path transformation to.