Skip to content

Commit b53ca90

Browse files
committed
Mark duplicate import removal suggestion tool only
1 parent 743d019 commit b53ca90

9 files changed

+1
-11
lines changed

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4932,7 +4932,7 @@ impl<'a> Resolver<'a> {
49324932
Some((directive, _, true)) if should_remove_import && !directive.is_glob() => {
49334933
// Simple case - remove the entire import. Due to the above match arm, this can
49344934
// only be a single use so just remove it entirely.
4935-
err.span_suggestion_hidden(
4935+
err.tool_only_span_suggestion(
49364936
directive.use_span_with_attributes,
49374937
"remove unnecessary import",
49384938
String::new(),

src/test/ui/double-type-import.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | use self::bar::X;
77
| ^^^^^^^^^^^^ `X` reimported here
88
|
99
= note: `X` must be defined only once in the type namespace of this module
10-
= help: remove unnecessary import
1110

1211
error: aborting due to previous error
1312

src/test/ui/imports/duplicate.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | use a::foo;
77
| ^^^^^^ `foo` reimported here
88
|
99
= note: `foo` must be defined only once in the value namespace of this module
10-
= help: remove unnecessary import
1110

1211
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
1312
--> $DIR/duplicate.rs:46:15

src/test/ui/issues/issue-26886.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | use std::sync::Arc;
77
| ^^^^^^^^^^^^^^ `Arc` reimported here
88
|
99
= note: `Arc` must be defined only once in the type namespace of this module
10-
= help: remove unnecessary import
1110

1211
error[E0252]: the name `sync` is defined multiple times
1312
--> $DIR/issue-26886.rs:4:5
@@ -19,7 +18,6 @@ LL | use std::sync;
1918
| ^^^^^^^^^ `sync` reimported here
2019
|
2120
= note: `sync` must be defined only once in the type namespace of this module
22-
= help: remove unnecessary import
2321

2422
error: aborting due to 2 previous errors
2523

src/test/ui/issues/issue-52891.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | use issue_52891::a;
77
| ^^^^^^^^^^^^^^ `a` reimported here
88
|
99
= note: `a` must be defined only once in the type namespace of this module
10-
= help: remove unnecessary import
1110

1211
error[E0252]: the name `a` is defined multiple times
1312
--> $DIR/issue-52891.rs:14:19
@@ -125,7 +124,6 @@ LL | use issue_52891::n;
125124
| ^^^^^^^^^^^^^^ `n` reimported here
126125
|
127126
= note: `n` must be defined only once in the type namespace of this module
128-
= help: remove unnecessary import
129127

130128
error: aborting due to 10 previous errors
131129

src/test/ui/proc-macro/shadow.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ LL | extern crate derive_a;
88
| ^^^^^^^^^^^^^^^^^^^^^^ `derive_a` reimported here
99
|
1010
= note: `derive_a` must be defined only once in the type namespace of this module
11-
= help: remove unnecessary import
1211

1312
error: aborting due to previous error
1413

src/test/ui/resolve/resolve-conflict-import-vs-import.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | use std::mem::transmute;
77
| ^^^^^^^^^^^^^^^^^^^ `transmute` reimported here
88
|
99
= note: `transmute` must be defined only once in the value namespace of this module
10-
= help: remove unnecessary import
1110

1211
error: aborting due to previous error
1312

src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | use core;
77
| ^^^^ `core` reimported here
88
|
99
= note: `core` must be defined only once in the type namespace of this module
10-
= help: remove unnecessary import
1110

1211
error: aborting due to previous error
1312

src/test/ui/use/use-paths-as-items.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | use std::mem;
77
| ^^^^^^^^ `mem` reimported here
88
|
99
= note: `mem` must be defined only once in the type namespace of this module
10-
= help: remove unnecessary import
1110

1211
error: aborting due to previous error
1312

0 commit comments

Comments
 (0)