-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
FCW Lint when using an ambiguously glob imported trait #149058
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
Conversation
This comment has been minimized.
This comment has been minimized.
|
Addressed your comments and updated pr title and description. @rustbot ready |
| 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")); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add some kind of suggestion like:
Consider importing `{trait_name}` directly:
+ use m1::{trait_name};
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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. |
|
@bors r- Still some left to fix. |
|
Commit 65c70e4 has been unapproved. |
3a2dae5 to
8888a6f
Compare
|
I did Sorry for being a bit to fast @rustbot ready |
This comment has been minimized.
This comment has been minimized.
|
@rustbot author Note to self: never do OSS when away from home. |
8888a6f to
3369a17
Compare
|
Did the commands locally and everything works. @rustbot ready |
|
@bors r+ |
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
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
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
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
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