Skip to content

resolve: Scope visiting doesn't need an Ident#80782

Merged
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:viscopes
Jan 11, 2021
Merged

resolve: Scope visiting doesn't need an Ident#80782
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:viscopes

Conversation

@petrochenkov
Copy link
Copy Markdown
Contributor

Resolution scope visitor (fn visit_scopes) currently takes an Ident parameter, but it doesn't need a full identifier, or even its span, it only needs the SyntaxContext part.
The SyntaxContext part is necessary because scope visitor has to jump to macro definition sites, so it has to be directed by macro expansion information somehow.

I think it's clearer to pass only the necessary part.
Yes, usually visiting happens as a part of an identifier resolution, but in cases like collecting traits in scope (#80765) or collecting typo suggestions that's not the case.

r? @matthewjasper

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

5 participants