-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
resolve: Some refactorings in preparation for uniform paths 2.0 #54336
Conversation
r? @eddyb |
3f65f15
to
28f4b6d
Compare
@@ -591,7 +575,29 @@ impl<'a, 'cl> Resolver<'a, 'cl> { | |||
// should be available before the derive is expanded for compatibility. | |||
// It's mess in general, so we are being conservative for now. | |||
|
|||
assert!(ns == TypeNS || ns == MacroNS); | |||
enum WhereToResolve<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd almost want this to be named Scope
and to replace some of the other infrastructure, like ModuleOrUniformRoot
. But we can leave it like this for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there's still a lot of place for refactoring, e.g. I want to merge this early_resolve_ident_in_lexical_scope
with resolve_ident_in_lexical_scope
eventually as well.
LGTM overall. This seems to also include a different PR? (the "after derive" bit) |
The "after derive" (or rather "test/bench") bit is included because it was a temporary restriction for beta, but now it can be removed due to one of the previous commits from this PR (1892126), so it's kinda logically related. |
r? @alexcrichton who reviewed the previous related PRs |
@bors: r+ |
📌 Commit 28f4b6df2e303b893d4f411c44d8203e21e7890f has been approved by |
🔒 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
|
☔ The latest upstream changes (presumably #54575) made this pull request unmergeable. Please resolve the merge conflicts. |
28f4b6d
to
0f34a51
Compare
@bors r=alexcrichton |
📌 Commit 0f34a51fb4f9d83f0c0264479448dddd8062265e has been approved by |
☔ The latest upstream changes (presumably #53824) made this pull request unmergeable. Please resolve the merge conflicts. |
Blocked on #54605 (which will become un-backportable if this PR is landed first). |
@bors r=alexcrichton |
📌 Commit b6a366e116511712930d5261ad8c4449e2bf481c has been approved by |
🔒 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
|
…o macro resolution
…ual left-to-right order
…scope resolution function `fn resolve_legacy_scope`/`fn resolve_lexical_macro_path_segment` -> `fn early_resolve_ident_in_lexical_scope`
`NameBinding`s instead of `Def`s
The restrictions were introduced in rust-lang#54277 and no longer necessary now because legacy plugins are now expanded in usual left-to-right order
@bors r=alexcrichton |
📌 Commit 0d8e9cd has been approved by |
resolve: Some refactorings in preparation for uniform paths 2.0 The main result is that in-scope resolution performed during macro expansion / import resolution is now consolidated in a single function (`fn early_resolve_ident_in_lexical_scope`), which can now be used for resolving first import segments as well when uniform paths are enabled. r? @ghost
☀️ Test successful - status-appveyor, status-travis |
The main result is that in-scope resolution performed during macro expansion / import resolution is now consolidated in a single function (
fn early_resolve_ident_in_lexical_scope
), which can now be used for resolving first import segments as well when uniform paths are enabled.r? @ghost