Skip to content
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: Scope visiting doesn't need an Ident #80782

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

petrochenkov
Copy link
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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 7, 2021
)
| Res::SelfTy(..)),
) | Res::SelfTy(..)
),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.r.hygienic_lexical_parent(search_module, &mut span_data.ctxt),
break
);
ident.span = span_data.span();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will go away in #80765 which reuses visit_scopes for this logic.

};
ident.span = span_data.span();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not yet refactored to use visit_scopes, but it should also go away eventually.

@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 9, 2021

📌 Commit 3ff866e has been approved by matthewjasper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 9, 2021
@bors
Copy link
Contributor

bors commented Jan 10, 2021

⌛ Testing commit 3ff866e with merge 10b96fdd6c1f290c822c5b49339678e12336368e...

@bors
Copy link
Contributor

bors commented Jan 10, 2021

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 10, 2021
@petrochenkov
Copy link
Contributor Author

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 10, 2021
@bors
Copy link
Contributor

bors commented Jan 10, 2021

⌛ Testing commit 3ff866e with merge 26d451f...

@bors
Copy link
Contributor

bors commented Jan 11, 2021

☀️ Test successful - checks-actions
Approved by: matthewjasper
Pushing 26d451f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 11, 2021
@bors bors merged commit 26d451f into rust-lang:master Jan 11, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 11, 2021
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