diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-03-11 09:50:50 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-03-23 13:05:30 -0700 |
| commit | 0a4ecf34384e895d18afabeed463110040b15b94 (patch) | |
| tree | e4c3f7cc43737836c377ebbf72466c278a750585 | |
| parent | ce90db1ff103224bc2a63e7a9ac503259fbe7eb0 (diff) | |
| download | rust-0a4ecf34384e895d18afabeed463110040b15b94.tar.gz rust-0a4ecf34384e895d18afabeed463110040b15b94.zip | |
Mark duplicate import removal suggestion tool only
| -rw-r--r-- | src/librustc_resolve/lib.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/double-type-import.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/imports/duplicate.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-26886.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-52891.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/proc-macro/shadow.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/resolve/resolve-conflict-import-vs-import.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/use/use-paths-as-items.stderr | 1 |
9 files changed, 1 insertions, 11 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 4c5b9e3675b..38ca5f0b664 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -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(), diff --git a/src/test/ui/double-type-import.stderr b/src/test/ui/double-type-import.stderr index d5e153d22ad..a2f30d82ec3 100644 --- a/src/test/ui/double-type-import.stderr +++ b/src/test/ui/double-type-import.stderr @@ -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 diff --git a/src/test/ui/imports/duplicate.stderr b/src/test/ui/imports/duplicate.stderr index f85a265487b..cc897b2b6b7 100644 --- a/src/test/ui/imports/duplicate.stderr +++ b/src/test/ui/imports/duplicate.stderr @@ -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 diff --git a/src/test/ui/issues/issue-26886.stderr b/src/test/ui/issues/issue-26886.stderr index 6002befe0d8..e2b925ec5a7 100644 --- a/src/test/ui/issues/issue-26886.stderr +++ b/src/test/ui/issues/issue-26886.stderr @@ -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 @@ -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 diff --git a/src/test/ui/issues/issue-52891.stderr b/src/test/ui/issues/issue-52891.stderr index 895e3a77946..9173c02bcd8 100644 --- a/src/test/ui/issues/issue-52891.stderr +++ b/src/test/ui/issues/issue-52891.stderr @@ -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 @@ -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 diff --git a/src/test/ui/proc-macro/shadow.stderr b/src/test/ui/proc-macro/shadow.stderr index 597c05434f3..08057e16349 100644 --- a/src/test/ui/proc-macro/shadow.stderr +++ b/src/test/ui/proc-macro/shadow.stderr @@ -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 diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr index 34f18feb9dc..8df68ad3229 100644 --- a/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr +++ b/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr @@ -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 diff --git a/src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr b/src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr index cfae699b6ed..28333228a29 100644 --- a/src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr +++ b/src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr @@ -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 diff --git a/src/test/ui/use/use-paths-as-items.stderr b/src/test/ui/use/use-paths-as-items.stderr index 43ebbf157c3..b09001a9bcd 100644 --- a/src/test/ui/use/use-paths-as-items.stderr +++ b/src/test/ui/use/use-paths-as-items.stderr @@ -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 |
