Skip to content

Commit 67bdf12

Browse files
committed
Make impl and ! removal suggestion short
1 parent b249e73 commit 67bdf12

File tree

4 files changed

+6
-28
lines changed

4 files changed

+6
-28
lines changed

compiler/rustc_parse/src/errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ pub(crate) struct ExpectedTraitInTraitImplFoundType {
17841784
#[diag(parse_extra_impl_keyword_in_trait_impl)]
17851785
pub(crate) struct ExtraImplKeywordInTraitImpl {
17861786
#[primary_span]
1787-
#[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
1787+
#[suggestion(code = "", applicability = "maybe-incorrect", style = "short")]
17881788
pub extra_impl_kw: Span,
17891789
#[note]
17901790
pub impl_trait_span: Span,
@@ -2890,7 +2890,7 @@ pub(crate) struct MacroRulesMissingBang {
28902890
#[diag(parse_macro_name_remove_bang)]
28912891
pub(crate) struct MacroNameRemoveBang {
28922892
#[primary_span]
2893-
#[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
2893+
#[suggestion(code = "", applicability = "machine-applicable", style = "short")]
28942894
pub span: Span,
28952895
}
28962896

tests/ui/impl-trait/extra-impl-in-trait-impl.stderr

+2-12
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,25 @@ error: unexpected `impl` keyword
22
--> $DIR/extra-impl-in-trait-impl.rs:8:18
33
|
44
LL | impl<T: Default> impl Default for S<T> {
5-
| ^^^^^
5+
| ^^^^^ help: remove the extra `impl`
66
|
77
note: this is parsed as an `impl Trait` type, but a trait is expected at this position
88
--> $DIR/extra-impl-in-trait-impl.rs:8:18
99
|
1010
LL | impl<T: Default> impl Default for S<T> {
1111
| ^^^^^^^^^^^^
12-
help: remove the extra `impl`
13-
|
14-
LL - impl<T: Default> impl Default for S<T> {
15-
LL + impl<T: Default> Default for S<T> {
16-
|
1712

1813
error: unexpected `impl` keyword
1914
--> $DIR/extra-impl-in-trait-impl.rs:14:6
2015
|
2116
LL | impl impl Default for S2 {
22-
| ^^^^^
17+
| ^^^^^ help: remove the extra `impl`
2318
|
2419
note: this is parsed as an `impl Trait` type, but a trait is expected at this position
2520
--> $DIR/extra-impl-in-trait-impl.rs:14:6
2621
|
2722
LL | impl impl Default for S2 {
2823
| ^^^^^^^^^^^^
29-
help: remove the extra `impl`
30-
|
31-
LL - impl impl Default for S2 {
32-
LL + impl Default for S2 {
33-
|
3424

3525
error: aborting due to 2 previous errors
3626

tests/ui/macros/bang-after-name.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ error: macro names aren't followed by a `!`
22
--> $DIR/bang-after-name.rs:4:17
33
|
44
LL | macro_rules! foo! {
5-
| ^
6-
|
7-
help: remove the `!`
8-
|
9-
LL - macro_rules! foo! {
10-
LL + macro_rules! foo {
11-
|
5+
| ^ help: remove the `!`
126

137
error: aborting due to 1 previous error
148

tests/ui/macros/missing-bang-in-decl.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ error: macro names aren't followed by a `!`
2424
--> $DIR/missing-bang-in-decl.rs:10:16
2525
|
2626
LL | macro_rules bar! {
27-
| ^
28-
|
29-
help: remove the `!`
30-
|
31-
LL - macro_rules bar! {
32-
LL + macro_rules bar {
33-
|
27+
| ^ help: remove the `!`
3428

3529
error: aborting due to 3 previous errors
3630

0 commit comments

Comments
 (0)