Skip to content

Commit

Permalink
Mark duplicate import removal suggestion tool only
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 17, 2019
1 parent 743d019 commit b53ca90
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4932,7 +4932,7 @@ impl<'a> Resolver<'a> {
Some((directive, _, true)) if should_remove_import && !directive.is_glob() => {
// Simple case - remove the entire import. Due to the above match arm, this can
// only be a single use so just remove it entirely.
err.span_suggestion_hidden(
err.tool_only_span_suggestion(
directive.use_span_with_attributes,
"remove unnecessary import",
String::new(),
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/double-type-import.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LL | use self::bar::X;
| ^^^^^^^^^^^^ `X` reimported here
|
= note: `X` must be defined only once in the type namespace of this module
= help: remove unnecessary import

error: aborting due to previous error

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/imports/duplicate.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LL | use a::foo;
| ^^^^^^ `foo` reimported here
|
= note: `foo` must be defined only once in the value namespace of this module
= help: remove unnecessary import

error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
--> $DIR/duplicate.rs:46:15
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/issues/issue-26886.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LL | use std::sync::Arc;
| ^^^^^^^^^^^^^^ `Arc` reimported here
|
= note: `Arc` must be defined only once in the type namespace of this module
= help: remove unnecessary import

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

error: aborting due to 2 previous errors

Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/issues/issue-52891.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LL | use issue_52891::a;
| ^^^^^^^^^^^^^^ `a` reimported here
|
= note: `a` must be defined only once in the type namespace of this module
= help: remove unnecessary import

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

error: aborting due to 10 previous errors

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/proc-macro/shadow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ LL | extern crate derive_a;
| ^^^^^^^^^^^^^^^^^^^^^^ `derive_a` reimported here
|
= note: `derive_a` must be defined only once in the type namespace of this module
= help: remove unnecessary import

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LL | use std::mem::transmute;
| ^^^^^^^^^^^^^^^^^^^ `transmute` reimported here
|
= note: `transmute` must be defined only once in the value namespace of this module
= help: remove unnecessary import

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LL | use core;
| ^^^^ `core` reimported here
|
= note: `core` must be defined only once in the type namespace of this module
= help: remove unnecessary import

error: aborting due to previous error

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/use/use-paths-as-items.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LL | use std::mem;
| ^^^^^^^^ `mem` reimported here
|
= note: `mem` must be defined only once in the type namespace of this module
= help: remove unnecessary import

error: aborting due to previous error

Expand Down

0 comments on commit b53ca90

Please sign in to comment.