Skip to content

resolve: Some import resolution cleanups#154435

Open
petrochenkov wants to merge 4 commits intorust-lang:mainfrom
petrochenkov:cleandecl
Open

resolve: Some import resolution cleanups#154435
petrochenkov wants to merge 4 commits intorust-lang:mainfrom
petrochenkov:cleandecl

Conversation

@petrochenkov
Copy link
Contributor

See the individual commits

Avoid two of its uses in diagnostic reporting and effective visibility collection.
The method is only supposed to be used inside the import resolution algorithm, and the removed uses happened after import resolution already converged.

Some comments are also added.
Using `self.(non_)glob_decl` directly makes it more clear.
Using `self.(non_)glob_decl` directly makes it more clear.
It is no longer needed to pass import validation, and the removal avoids some secondary errors.

Also add a couple of asserts
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 26, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 26, 2026

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 11 candidates

mod empty {}
use empty::issue_56125; //~ ERROR unresolved import `empty::issue_56125`
use issue_56125::*; //~ ERROR `issue_56125` is ambiguous
use issue_56125::*;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The glob prefix now unambiguously resolves to the erroneous use empty::issue_56125 during error reporting.

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants