Skip to content

resolve: Partially convert ambiguous_glob_imports lint into a hard error#149195

Open
petrochenkov wants to merge 1 commit intorust-lang:mainfrom
petrochenkov:globamberr
Open

resolve: Partially convert ambiguous_glob_imports lint into a hard error#149195
petrochenkov wants to merge 1 commit intorust-lang:mainfrom
petrochenkov:globamberr

Conversation

@petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Nov 21, 2025

View all comments

I'm tired of this logic interfering with any attempts to fix or refactor glob imports.

Change description for lang team: #149195 (comment).
Part of #114095.

@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2025

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@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 Nov 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
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

@petrochenkov
Copy link
Contributor Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 21, 2025
resolve: Convert `ambiguous_glob_imports` lint into a hard error
@petrochenkov petrochenkov added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 21, 2025
@rust-bors
Copy link
Contributor

rust-bors bot commented Nov 21, 2025

☀️ Try build successful (CI)
Build commit: 446cb60 (446cb600aa4837dd6c513f14fa0d25a909b177d7, parent: e22dab387f6b4f6a87dfc54ac2f6013dddb41e68)

@petrochenkov
Copy link
Contributor Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-149195 created and queued.
🤖 Automatically detected try build 446cb60
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@bors

This comment was marked as resolved.

@craterbot
Copy link
Collaborator

🚧 Experiment pr-149195 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149195 is completed!
📊 2676 regressed and 6 fixed (741888 total)
📊 2000 spurious results on the retry-regessed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149195/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 1, 2025
@nnethercote
Copy link
Contributor

@petrochenkov: seems like a lot of regressions :( Should I review this?

@petrochenkov
Copy link
Contributor Author

@petrochenkov: seems like a lot of regressions :( Should I review this?

Not yet.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@petrochenkov
Copy link
Contributor Author

The largest part of the regressions are from openssl-0.10.*, it's a known issue that is addressed by #147984.
So this is blocked by #147984 now.
@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 1, 2025
@yaahc
Copy link
Member

yaahc commented Dec 9, 2025

Correct me if I'm wrong on this one

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Dec 9, 2025
@craterbot
Copy link
Collaborator

🎉 Experiment pr-149195-4 is completed!
📊 90 regressed and 2 fixed (798220 total)
📊 2296 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149195-4/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Feb 5, 2026
github-actions bot pushed a commit to rust-lang/stdarch that referenced this pull request Feb 5, 2026
resolve: Mark items under exported ambiguous imports as exported

After rust-lang/rust#147984 one of the imports in an ambiguous import set becomes accessible under a deny-by-default deprecation lint.

So if it points to something, that something needs to be marked as exported, so its MIR is encoded into metadata, its symbol is not lost from object files, etc.
The added test shows an example.
This fixes around 10-20 crater regressions found in rust-lang/rust#149195 (comment).

Unblocks rust-lang/rust#149195.
@petrochenkov
Copy link
Contributor Author

Blocked on #152549.
@rustbot blocked

@rust-bors

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

#152549 has landed, unblocking.
@rustbot author

@rustbot

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

@bors try

@rust-bors

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

TODO: @craterbot run mode=check-only p=1 crates=https://crater-reports.s3.amazonaws.com/pr-149195-4/retry-regressed-list.txt

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 2, 2026

☀️ Try build successful (CI)
Build commit: 7cd76c0 (7cd76c029787cd975f1d5f139fb14570ac4c41c9, parent: ddd36bd57051f796850345b76c17e9402e28a9e4)

@petrochenkov
Copy link
Contributor Author

@craterbot
Copy link
Collaborator

👌 Experiment pr-149195-5 created and queued.
🤖 Automatically detected try build 7cd76c0
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🚧 Experiment pr-149195-5 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149195-5 is completed!
📊 57 regressed and 0 fixed (2257 total)
📊 180 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149195-5/retry-regressed-list.txt

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

@bors try

@rust-bors

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

TODO: @craterbot run mode=check-only p=1 crates=https://crater-reports.s3.amazonaws.com/pr-149195-5/retry-regressed-list.txt

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 13, 2026

☀️ Try build successful (CI)
Build commit: d578b6c (d578b6cfee5b7dc31169715f836745f9e96213f1, parent: 8db65c71725664d85d06ec96ee3e575665de1f6a)

@petrochenkov
Copy link
Contributor Author

@craterbot
Copy link
Collaborator

👌 Experiment pr-149195-6 created and queued.
🤖 Automatically detected try build d578b6c
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🚧 Experiment pr-149195-6 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149195-6 is completed!
📊 32 regressed and 0 fixed (237 total)
📊 41 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149195-6/retry-regressed-list.txt

@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@petrochenkov
Copy link
Contributor Author

petrochenkov commented Mar 19, 2026

Change description for lang team

This PR turns a subset of the ambiguous_glob_imports deprecation lint into a hard error.
The lint was implemented more than 2.5 years ago, and made deny-by-default and report-in-dependencies 8.5 months ago.

The exact affected subset is hard to describe, because it's very heuristic-based.
The heuristics are hard to maintain and are easily affected by any changes to import resolution, so removing them is the whole point of this PR.

It's easier to say what is still a lint and not a hard error:

  • Cross-crate cases recently added by resolve: Preserve ambiguous glob reexports in crate metadata #147984
  • Specific cases encountered in outdated versions of noise, rustybuzz and pdf, breaking them (especially noise) causes hundreds of regressions.
  • Anything else requiring only local reasoning (one import), and not heuristics based on analyzing whole import chains.

Crater run can be found in #149195 (comment).
It shows 31 non-spurious regressions, 9 of those are from an outdated version of ark-test-curves, and 5 more from outdated versions of sv-parser-parser.

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

Labels

A-resolve Area: Name/path resolution done by `rustc_resolve` specifically I-lang-nominated Nominated for discussion during a lang team meeting. S-waiting-on-t-lang Status: Awaiting decision from T-lang T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants