From 44730271f79e74def2dc09315268df64f3ea6271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sun, 10 Mar 2019 22:25:23 -0700 Subject: [PATCH] Hide obvious suggestion from cli output --- src/librustc_resolve/lib.rs | 2 +- src/test/ui/error-codes/E0430.stderr | 6 ++---- .../ui/issues/issue-45829/import-twice.stderr | 6 ++---- src/test/ui/issues/issue-52891.stderr | 18 +++++------------- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 973c58a67a5..4c5b9e3675b 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -5112,7 +5112,7 @@ impl<'a> Resolver<'a> { // 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 9f8b053de2c..d8e4a802959 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 2a1ac576511..656b011bc3b 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 6068c975057..895e3a77946 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