FCW Lint when using an ambiguously glob imported trait#149058
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Jan 20, 2026
Merged
FCW Lint when using an ambiguously glob imported trait#149058rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
Addressed your comments and updated pr title and description. @rustbot ready |
Comment on lines
735
to
740
| self.tcx.node_lint(AMBIGUOUS_TRAIT_GLOB_IMPORTS, segment.hir_id, |diag| { | ||
| diag.primary_message(format!("Use of ambiguously glob imported trait `{trait_name}`")) | ||
| .span(segment.ident.span) | ||
| .span_label(import_span, format!("`{trait_name}`imported ambiguously here")) | ||
| .help(format!("Import `{trait_name}` explicitly")); | ||
| }); |
Contributor
Author
There was a problem hiding this comment.
Is it possible to add some kind of suggestion like:
Consider importing `{trait_name}` directly:
+ use m1::{trait_name};
This was referenced Nov 20, 2025
Contributor
Author
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
r? @lcnr or someone else from types for the method resolution part. This will need to go through crater and then lang team after the review. |
Contributor
|
@bors r- Still some left to fix. |
Contributor
|
Commit 65c70e4 has been unapproved. |
3a2dae5 to
8888a6f
Compare
Contributor
Author
|
I did Sorry for being a bit to fast @rustbot ready |
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
@rustbot author Note to self: never do OSS when away from home. |
8888a6f to
3369a17
Compare
Contributor
Author
|
Did the commands locally and everything works. @rustbot ready |
Contributor
|
@bors r+ |
Contributor
rust-bors bot
pushed a commit
that referenced
this pull request
Jan 20, 2026
Rollup of 6 pull requests Successful merges: - #147611 (Stabilize `-Zremap-path-scope`) - #149058 (FCW Lint when using an ambiguously glob imported trait) - #149644 (Create x86_64-unknown-linux-gnuasan target which enables ASAN by default) - #150524 (Test that -Zbuild-std=core works on a variety of profiles) - #151394 (Fix typos: 'occured' -> 'occurred' and 'non_existant' -> 'non_existent') - #151396 (`rustc_queries!`: Don't push the `(cache)` modifier twice) r? @ghost
rust-timer
added a commit
that referenced
this pull request
Jan 20, 2026
Rollup merge of #149058 - amb-trait-lint, r=petrochenkov FCW Lint when using an ambiguously glob imported trait Related to #147992. Report a lint when using an ambiguously glob import trait, this is a FCW because this should not be allowed. r? @petrochenkov
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Jan 20, 2026
Rollup of 6 pull requests Successful merges: - rust-lang/rust#147611 (Stabilize `-Zremap-path-scope`) - rust-lang/rust#149058 (FCW Lint when using an ambiguously glob imported trait) - rust-lang/rust#149644 (Create x86_64-unknown-linux-gnuasan target which enables ASAN by default) - rust-lang/rust#150524 (Test that -Zbuild-std=core works on a variety of profiles) - rust-lang/rust#151394 (Fix typos: 'occured' -> 'occurred' and 'non_existant' -> 'non_existent') - rust-lang/rust#151396 (`rustc_queries!`: Don't push the `(cache)` modifier twice) r? @ghost
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jan 21, 2026
Rollup of 6 pull requests Successful merges: - rust-lang/rust#147611 (Stabilize `-Zremap-path-scope`) - rust-lang/rust#149058 (FCW Lint when using an ambiguously glob imported trait) - rust-lang/rust#149644 (Create x86_64-unknown-linux-gnuasan target which enables ASAN by default) - rust-lang/rust#150524 (Test that -Zbuild-std=core works on a variety of profiles) - rust-lang/rust#151394 (Fix typos: 'occured' -> 'occurred' and 'non_existant' -> 'non_existent') - rust-lang/rust#151396 (`rustc_queries!`: Don't push the `(cache)` modifier twice) r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #147992.
Report a lint when using an ambiguously glob import trait, this is a FCW because this should not be allowed.
r? @petrochenkov