-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[WIP] Generic Associated Types Name Resolution #46146
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
src/librustc_resolve/lib.rs
Outdated
@@ -1895,7 +1895,9 @@ impl<'a> Resolver<'a> { | |||
}); | |||
} | |||
TraitItemKind::Type(..) => { | |||
this.with_type_parameter_rib(NoTypeParameters, |this| { | |||
let type_parameters = HasTypeParameters(&trait_item.generics, | |||
ItemRibKind); |
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.
Is ItemRibKind
the right RibKind
?
src/librustc_resolve/lib.rs
Outdated
// We also need a new scope for the associated type | ||
// specific type parameters. | ||
let type_parameters = | ||
HasTypeParameters(&impl_item.generics, ItemRibKind); |
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.
Is ItemRibKind
the right RibKind
? Is this the right way to visit these types? I copied what was done for methods a few lines above this.
☔ The latest upstream changes (presumably #45771) made this pull request unmergeable. Please resolve the merge conflicts. |
…ld which was never used. Lifting the HasTypeParameters rib to all trait item kinds and all impl item kinds
This has been completed and merged into the other PR I had open for parsing (#45904). |
This PR builds off of the to-be-merged PR for parsing generic associated types. In fact, the only new commit is the latest one which makes changes to
src/librustc_resolve/lib.rs
. You should look only at that file when reviewing this PR. Once the other PR is merged and this PR is rebased, the remaining files will disappear.This PR is a work in progress and only meant to give me a way to show @nikomatsakis my progress and ask questions. I am still waiting for the build to finish locally on my computer and then I will update this PR as I find and fix errors.
Tracking Issue: #44265
r? @nikomatsakis
Notes & Questions for Reviewers
Something to check: Am I using the right
RibKind
variants? I don't actually fully understand the differences from the docs in the code so it's quite possible that I didn't choose the right one.From the instructions by @nikomatsakis on the Tracking Issue:
I had to modify this a bit because I chose different
RibKind
s for Methods and Types. If it turns out theRibKind
should be the same in all cases, I can lift out that call towith_type_parameter_rib
and add theHasTypeParameters
rib only once.By the end of this, the run-pass tests should actually pass! 🎉
It's possible that I still need to add more tests before this should be merged