Skip to content

Commit 4473027

Browse files
committed
Hide obvious suggestion from cli output
1 parent 3211f38 commit 4473027

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5112,7 +5112,7 @@ impl<'a> Resolver<'a> {
51125112
// extra for the comma.
51135113
span.lo().0 - (prev_comma.as_bytes().len() as u32) - 1
51145114
));
5115-
err.span_suggestion(
5115+
err.tool_only_span_suggestion(
51165116
span, message, String::new(), Applicability::MaybeIncorrect,
51175117
);
51185118
return;

src/test/ui/error-codes/E0430.stderr

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ error[E0252]: the name `fmt` is defined multiple times
1010
--> $DIR/E0430.rs:1:22
1111
|
1212
LL | use std::fmt::{self, self};
13-
| ------^^^^
14-
| | | |
15-
| | | `fmt` reimported here
16-
| | help: remove unnecessary import
13+
| ---- ^^^^ `fmt` reimported here
14+
| |
1715
| previous import of the module `fmt` here
1816
|
1917
= note: `fmt` must be defined only once in the type namespace of this module

src/test/ui/issues/issue-45829/import-twice.stderr

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ error[E0252]: the name `A` is defined multiple times
22
--> $DIR/import-twice.rs:6:14
33
|
44
LL | use foo::{A, A};
5-
| ---^
6-
| || |
7-
| || `A` reimported here
8-
| |help: remove unnecessary import
5+
| - ^ `A` reimported here
6+
| |
97
| previous import of the type `A` here
108
|
119
= note: `A` must be defined only once in the type namespace of this module

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

+5-13
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ LL | use issue_52891::a;
4444
| -------------- previous import of the module `a` here
4545
...
4646
LL | use issue_52891::{f, g, a};
47-
| --^
48-
| | |
49-
| | `a` reimported here
50-
| help: remove unnecessary import
47+
| ^ `a` reimported here
5148
|
5249
= note: `a` must be defined only once in the type namespace of this module
5350

@@ -82,16 +79,11 @@ LL | a,
8279
error[E0252]: the name `a` is defined multiple times
8380
--> $DIR/issue-52891.rs:26:5
8481
|
85-
LL | use issue_52891::a;
86-
| -------------- previous import of the module `a` here
82+
LL | use issue_52891::a;
83+
| -------------- previous import of the module `a` here
8784
...
88-
LL | m,
89-
| ______-
90-
LL | | a};
91-
| | ^
92-
| | |
93-
| |_____`a` reimported here
94-
| help: remove unnecessary import
85+
LL | a};
86+
| ^ `a` reimported here
9587
|
9688
= note: `a` must be defined only once in the type namespace of this module
9789

0 commit comments

Comments
 (0)