1
Fork 0

Make impl and ! removal suggestion short

This commit is contained in:
Esteban Küber 2024-07-11 21:04:01 +00:00
parent 692bc344d5
commit c2b3287483
4 changed files with 6 additions and 28 deletions

View file

@ -1784,7 +1784,7 @@ pub(crate) struct ExpectedTraitInTraitImplFoundType {
#[diag(parse_extra_impl_keyword_in_trait_impl)] #[diag(parse_extra_impl_keyword_in_trait_impl)]
pub(crate) struct ExtraImplKeywordInTraitImpl { pub(crate) struct ExtraImplKeywordInTraitImpl {
#[primary_span] #[primary_span]
#[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")] #[suggestion(code = "", applicability = "maybe-incorrect", style = "short")]
pub extra_impl_kw: Span, pub extra_impl_kw: Span,
#[note] #[note]
pub impl_trait_span: Span, pub impl_trait_span: Span,
@ -2890,7 +2890,7 @@ pub(crate) struct MacroRulesMissingBang {
#[diag(parse_macro_name_remove_bang)] #[diag(parse_macro_name_remove_bang)]
pub(crate) struct MacroNameRemoveBang { pub(crate) struct MacroNameRemoveBang {
#[primary_span] #[primary_span]
#[suggestion(code = "", applicability = "machine-applicable", style = "verbose")] #[suggestion(code = "", applicability = "machine-applicable", style = "short")]
pub span: Span, pub span: Span,
} }

View file

@ -2,35 +2,25 @@ error: unexpected `impl` keyword
--> $DIR/extra-impl-in-trait-impl.rs:8:18 --> $DIR/extra-impl-in-trait-impl.rs:8:18
| |
LL | impl<T: Default> impl Default for S<T> { LL | impl<T: Default> impl Default for S<T> {
| ^^^^^ | ^^^^^ help: remove the extra `impl`
| |
note: this is parsed as an `impl Trait` type, but a trait is expected at this position note: this is parsed as an `impl Trait` type, but a trait is expected at this position
--> $DIR/extra-impl-in-trait-impl.rs:8:18 --> $DIR/extra-impl-in-trait-impl.rs:8:18
| |
LL | impl<T: Default> impl Default for S<T> { LL | impl<T: Default> impl Default for S<T> {
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
help: remove the extra `impl`
|
LL - impl<T: Default> impl Default for S<T> {
LL + impl<T: Default> Default for S<T> {
|
error: unexpected `impl` keyword error: unexpected `impl` keyword
--> $DIR/extra-impl-in-trait-impl.rs:14:6 --> $DIR/extra-impl-in-trait-impl.rs:14:6
| |
LL | impl impl Default for S2 { LL | impl impl Default for S2 {
| ^^^^^ | ^^^^^ help: remove the extra `impl`
| |
note: this is parsed as an `impl Trait` type, but a trait is expected at this position note: this is parsed as an `impl Trait` type, but a trait is expected at this position
--> $DIR/extra-impl-in-trait-impl.rs:14:6 --> $DIR/extra-impl-in-trait-impl.rs:14:6
| |
LL | impl impl Default for S2 { LL | impl impl Default for S2 {
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
help: remove the extra `impl`
|
LL - impl impl Default for S2 {
LL + impl Default for S2 {
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,13 +2,7 @@ error: macro names aren't followed by a `!`
--> $DIR/bang-after-name.rs:4:17 --> $DIR/bang-after-name.rs:4:17
| |
LL | macro_rules! foo! { LL | macro_rules! foo! {
| ^ | ^ help: remove the `!`
|
help: remove the `!`
|
LL - macro_rules! foo! {
LL + macro_rules! foo {
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -24,13 +24,7 @@ error: macro names aren't followed by a `!`
--> $DIR/missing-bang-in-decl.rs:10:16 --> $DIR/missing-bang-in-decl.rs:10:16
| |
LL | macro_rules bar! { LL | macro_rules bar! {
| ^ | ^ help: remove the `!`
|
help: remove the `!`
|
LL - macro_rules bar! {
LL + macro_rules bar {
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors