diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 973c58a67a5d4a2847dcfb0dc0313a63893856fd..4c5b9e3675b47995ca327a23d2a853d57e42d666 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -5112,7 +5112,7 @@ fn add_suggestion_for_duplicate_nested_use( // extra for the comma. span.lo().0 - (prev_comma.as_bytes().len() as u32) - 1 )); - err.span_suggestion( + err.tool_only_span_suggestion( span, message, String::new(), Applicability::MaybeIncorrect, ); return; diff --git a/src/test/ui/error-codes/E0430.stderr b/src/test/ui/error-codes/E0430.stderr index 9f8b053de2cac99718d728bc10d479090e7b4ea4..d8e4a802959a04cfd915e9148b60d809b8f9d132 100644 --- a/src/test/ui/error-codes/E0430.stderr +++ b/src/test/ui/error-codes/E0430.stderr @@ -10,10 +10,8 @@ error[E0252]: the name `fmt` is defined multiple times --> $DIR/E0430.rs:1:22 | LL | use std::fmt::{self, self}; - | ------^^^^ - | | | | - | | | `fmt` reimported here - | | help: remove unnecessary import + | ---- ^^^^ `fmt` reimported here + | | | previous import of the module `fmt` here | = note: `fmt` must be defined only once in the type namespace of this module diff --git a/src/test/ui/issues/issue-45829/import-twice.stderr b/src/test/ui/issues/issue-45829/import-twice.stderr index 2a1ac57651138e8368035a61af5fae4cff1fb425..656b011bc3be80f465bb42d20f38a4bfb92e98b4 100644 --- a/src/test/ui/issues/issue-45829/import-twice.stderr +++ b/src/test/ui/issues/issue-45829/import-twice.stderr @@ -2,10 +2,8 @@ error[E0252]: the name `A` is defined multiple times --> $DIR/import-twice.rs:6:14 | LL | use foo::{A, A}; - | ---^ - | || | - | || `A` reimported here - | |help: remove unnecessary import + | - ^ `A` reimported here + | | | previous import of the type `A` here | = note: `A` must be defined only once in the type namespace of this module diff --git a/src/test/ui/issues/issue-52891.stderr b/src/test/ui/issues/issue-52891.stderr index 6068c97505767fd115895b8d5fec894111578383..895e3a77946efbf2f1bb73821c7f24266ea3fa61 100644 --- a/src/test/ui/issues/issue-52891.stderr +++ b/src/test/ui/issues/issue-52891.stderr @@ -44,10 +44,7 @@ LL | use issue_52891::a; | -------------- previous import of the module `a` here ... LL | use issue_52891::{f, g, a}; - | --^ - | | | - | | `a` reimported here - | help: remove unnecessary import + | ^ `a` reimported here | = note: `a` must be defined only once in the type namespace of this module @@ -82,16 +79,11 @@ LL | a, error[E0252]: the name `a` is defined multiple times --> $DIR/issue-52891.rs:26:5 | -LL | use issue_52891::a; - | -------------- previous import of the module `a` here +LL | use issue_52891::a; + | -------------- previous import of the module `a` here ... -LL | m, - | ______- -LL | | a}; - | | ^ - | | | - | |_____`a` reimported here - | help: remove unnecessary import +LL | a}; + | ^ `a` reimported here | = note: `a` must be defined only once in the type namespace of this module