Skip to content

Make lint ambiguous_glob_imports deny-by-default and report-in-deps #143011

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LorrensP-2158466
Copy link
Contributor

@LorrensP-2158466 LorrensP-2158466 commented Jun 25, 2025

This pr aims to finish the second part of #114095. It converts the ambiguous_glob_imports lint from a warning to an error.

Currently, only the lint definition and the related tests are changed, a crater run should provide us with information on whether we should go for this.

@rustbot
Copy link
Collaborator

rustbot commented Jun 25, 2025

r? @fee1-dead

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

@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 Jun 25, 2025
@LorrensP-2158466
Copy link
Contributor Author

LorrensP-2158466 commented Jun 25, 2025

There were 2 tests that I marked ignore because I didn't know how to change them.

@@ -1,4 +1,5 @@
//@ check-pass
//@ ignore-test
// ^^ don't know how to change this test
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 test

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, a test uses another test as a dependency.
I think you can use #[warn(ambiguous_glob_imports)] in tests/ui/imports/ambiguous-1.rs to make the dependency compile.

@@ -1,4 +1,5 @@
//@ build-pass
//@ ignore-test
// ^^ don't know how to change this test
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 test

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as in #143011 (comment).

@fmease fmease changed the title Convert ambiguous_glob_imports lint into an error Jun 25, 2025
@petrochenkov
Copy link
Contributor

@rustbot rustbot assigned petrochenkov and unassigned fee1-dead Jun 25, 2025
@petrochenkov
Copy link
Contributor

@bors try

@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 Jun 26, 2025
bors added a commit that referenced this pull request Jun 26, 2025
…=<try>

Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps

This pr aims to finish the second part of #114095. It converts the `ambiguous_glob_imports` lint from a warning to an error.

Currently, only the lint definition and the related tests are changed, a crater run should provide us with information on whether we should go for this.
@bors
Copy link
Collaborator

bors commented Jun 26, 2025

⌛ Trying commit 3be0b6b with merge 2b39fe7...

@bors
Copy link
Collaborator

bors commented Jun 26, 2025

☀️ Try build successful - checks-actions
Build commit: 2b39fe7 (2b39fe756f52bc2825bf5b2bfc385cab922dae10)

@petrochenkov
Copy link
Contributor

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-143011 created and queued.
🤖 Automatically detected try build 2b39fe7
🔍 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-143011 is now running

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

@craterbot
Copy link
Collaborator

🎉 Experiment pr-143011 is completed!
📊 19 regressed and 4 fixed (653904 total)
📰 Open the full 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

@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 Jun 28, 2025
@petrochenkov
Copy link
Contributor

The results are good, 15 regressions from the lint change.
I think we can merge this now, and turn the lint into a hard error in one more year.

@petrochenkov petrochenkov 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 Jun 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
6 participants