Simplify the item info collection visitor running before late resolution - #160515
Closed
oli-obk wants to merge 4 commits into
Closed
Simplify the item info collection visitor running before late resolution#160515oli-obk wants to merge 4 commits into
oli-obk wants to merge 4 commits into
Conversation
Contributor
Same is true for Not sure about At least |
Contributor
Author
|
I'll put the use_items commit directly into the PR that needs it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @petrochenkov
I mainly want 52cc1ac (use item collection in late resolution visitor), as my first step to refactor use item lowering needs to track the owner, which the info collection visitor doesn't do right now, and it seems annoying to add when there is a perfectly good visitor already tracking it right there.
I tried getting rid of the info collection visitor entirely, but counting the number of generic lifetime parameters of free items is necessary for diagnostics in the late visitor when visiting paths. A path can refer to an item that is visited later, so we haven't recorded the number of generic lifetime parameters yet (if we do it in the late visitor). If we collect them in the def collector, we have to handle macro invocations in generic parameter definition position. It wasn't clear to me how to handle that without severe spaghetti code, so the visitor stays around for now.