diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index eee17a73acf..092a2a10ab7 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -1215,14 +1215,14 @@ pub(crate) enum ExpectedSemiSugg { parse_sugg_change_this_to_semi, code = ";", applicability = "machine-applicable", - style = "verbose" + style = "short" )] ChangeToSemi(#[primary_span] Span), #[suggestion( parse_sugg_add_semi, - style = "verbose", code = ";", - applicability = "machine-applicable" + applicability = "machine-applicable", + style = "short" )] AddSemi(#[primary_span] Span), } diff --git a/tests/ui/let-else/let-else-missing-semicolon.stderr b/tests/ui/let-else/let-else-missing-semicolon.stderr index 778a0e244f8..99029ff33fe 100644 --- a/tests/ui/let-else/let-else-missing-semicolon.stderr +++ b/tests/ui/let-else/let-else-missing-semicolon.stderr @@ -2,27 +2,17 @@ error: expected `;`, found keyword `let` --> $DIR/let-else-missing-semicolon.rs:4:6 | LL | } - | ^ + | ^ help: add `;` here LL | let _ = ""; | --- unexpected token - | -help: add `;` here - | -LL | }; - | + error: expected `;`, found `}` --> $DIR/let-else-missing-semicolon.rs:8:6 | LL | } - | ^ + | ^ help: add `;` here LL | } | - unexpected token - | -help: add `;` here - | -LL | }; - | + error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-103425.stderr b/tests/ui/parser/issues/issue-103425.stderr index e7e1b7106b0..0efe3e3ca71 100644 --- a/tests/ui/parser/issues/issue-103425.stderr +++ b/tests/ui/parser/issues/issue-103425.stderr @@ -2,43 +2,28 @@ error: expected `;`, found `5.0` --> $DIR/issue-103425.rs:2:6 | LL | 3 - | ^ + | ^ help: add `;` here LL | LL | 5.0 | --- unexpected token - | -help: add `;` here - | -LL | 3; - | + error: expected `;`, found `3_i8` --> $DIR/issue-103425.rs:8:10 | LL | 2_u32 - | ^ + | ^ help: add `;` here LL | LL | 3_i8 | ---- unexpected token - | -help: add `;` here - | -LL | 2_u32; - | + error: expected `;`, found `5.0` --> $DIR/issue-103425.rs:10:9 | LL | 3_i8 - | ^ + | ^ help: add `;` here LL | LL | 5.0 | --- unexpected token - | -help: add `;` here - | -LL | 3_i8; - | + error: aborting due to 3 previous errors diff --git a/tests/ui/parser/issues/issue-118530-ice.stderr b/tests/ui/parser/issues/issue-118530-ice.stderr index a8a2327d0ce..3519fb8777f 100644 --- a/tests/ui/parser/issues/issue-118530-ice.stderr +++ b/tests/ui/parser/issues/issue-118530-ice.stderr @@ -30,11 +30,8 @@ LL | #[feature] | ---------- only `;` terminated statements or tail expressions are allowed after this attribute LL | attr::fn bar() -> String { | ^--- unexpected token - | -help: add `;` here - | -LL | attr::fn; bar() -> String { - | + + | | + | help: add `;` here error: `->` used for field access or method call --> $DIR/issue-118530-ice.rs:5:20 diff --git a/tests/ui/parser/issues/issue-3036.stderr b/tests/ui/parser/issues/issue-3036.stderr index 62a9c1d9752..3dd89b7e828 100644 --- a/tests/ui/parser/issues/issue-3036.stderr +++ b/tests/ui/parser/issues/issue-3036.stderr @@ -2,14 +2,9 @@ error: expected `;`, found `}` --> $DIR/issue-3036.rs:6:15 | LL | let _x = 3 - | ^ + | ^ help: add `;` here LL | } | - unexpected token - | -help: add `;` here - | -LL | let _x = 3; - | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr b/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr index 874e7b07163..57772de1e7a 100644 --- a/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr +++ b/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr @@ -2,40 +2,25 @@ error: expected `;`, found `println` --> $DIR/issue-87197-missing-semicolon.rs:6:16 | LL | let x = 100 - | ^ + | ^ help: add `;` here LL | println!("{}", x) | ------- unexpected token - | -help: add `;` here - | -LL | let x = 100; - | + error: expected `;`, found keyword `let` --> $DIR/issue-87197-missing-semicolon.rs:7:22 | LL | println!("{}", x) - | ^ + | ^ help: add `;` here LL | let y = 200 | --- unexpected token - | -help: add `;` here - | -LL | println!("{}", x); - | + error: expected `;`, found `println` --> $DIR/issue-87197-missing-semicolon.rs:8:16 | LL | let y = 200 - | ^ + | ^ help: add `;` here LL | println!("{}", y); | ------- unexpected token - | -help: add `;` here - | -LL | let y = 200; - | + error: aborting due to 3 previous errors diff --git a/tests/ui/parser/macros-no-semicolon.stderr b/tests/ui/parser/macros-no-semicolon.stderr index 4cf01e457d7..f310662dbb0 100644 --- a/tests/ui/parser/macros-no-semicolon.stderr +++ b/tests/ui/parser/macros-no-semicolon.stderr @@ -2,27 +2,17 @@ error: expected `;`, found `assert_eq` --> $DIR/macros-no-semicolon.rs:2:21 | LL | assert_eq!(1, 2) - | ^ + | ^ help: add `;` here LL | assert_eq!(3, 4) | --------- unexpected token - | -help: add `;` here - | -LL | assert_eq!(1, 2); - | + error: expected `;`, found `println` --> $DIR/macros-no-semicolon.rs:3:21 | LL | assert_eq!(3, 4) - | ^ + | ^ help: add `;` here LL | println!("hello"); | ------- unexpected token - | -help: add `;` here - | -LL | assert_eq!(3, 4); - | + error: aborting due to 2 previous errors diff --git a/tests/ui/parser/raw/raw-str-unbalanced.stderr b/tests/ui/parser/raw/raw-str-unbalanced.stderr index d3a9c342c03..eac8c06c1df 100644 --- a/tests/ui/parser/raw/raw-str-unbalanced.stderr +++ b/tests/ui/parser/raw/raw-str-unbalanced.stderr @@ -19,15 +19,10 @@ error: expected `;`, found `#` --> $DIR/raw-str-unbalanced.rs:10:28 | LL | const A: &'static str = r"" - | ^ + | ^ help: add `;` here ... LL | #[test] | - unexpected token - | -help: add `;` here - | -LL | const A: &'static str = r""; - | + error: too many `#` when terminating raw string --> $DIR/raw-str-unbalanced.rs:16:28 diff --git a/tests/ui/parser/recover/recover-missing-semi-before-item.stderr b/tests/ui/parser/recover/recover-missing-semi-before-item.stderr index 8a87d44c959..61c43f2f189 100644 --- a/tests/ui/parser/recover/recover-missing-semi-before-item.stderr +++ b/tests/ui/parser/recover/recover-missing-semi-before-item.stderr @@ -2,132 +2,82 @@ error: expected `;`, found keyword `struct` --> $DIR/recover-missing-semi-before-item.rs:6:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | struct Foo; | ------ unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found `union` --> $DIR/recover-missing-semi-before-item.rs:11:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | union Foo { | ----- unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `enum` --> $DIR/recover-missing-semi-before-item.rs:18:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | enum Foo { | ---- unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `fn` --> $DIR/recover-missing-semi-before-item.rs:25:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | fn foo() {} | -- unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `extern` --> $DIR/recover-missing-semi-before-item.rs:30:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | extern fn foo() {} | ------ unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `impl` --> $DIR/recover-missing-semi-before-item.rs:36:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | impl Foo {} | ---- unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `pub` --> $DIR/recover-missing-semi-before-item.rs:41:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | pub use bar::Bar; | --- unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `mod` --> $DIR/recover-missing-semi-before-item.rs:46:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | mod foo {} | --- unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `type` --> $DIR/recover-missing-semi-before-item.rs:51:16 | LL | let foo = 3 - | ^ + | ^ help: add `;` here LL | type Foo = usize; | ---- unexpected token - | -help: add `;` here - | -LL | let foo = 3; - | + error: expected `;`, found keyword `fn` --> $DIR/recover-missing-semi-before-item.rs:59:19 | LL | const X: i32 = 123 - | ^ + | ^ help: add `;` here LL | LL | fn main() {} | -- unexpected token - | -help: add `;` here - | -LL | const X: i32 = 123; - | + error: aborting due to 10 previous errors diff --git a/tests/ui/parser/recover/recover-missing-semi.stderr b/tests/ui/parser/recover/recover-missing-semi.stderr index 3e8cb37160e..ba479828538 100644 --- a/tests/ui/parser/recover/recover-missing-semi.stderr +++ b/tests/ui/parser/recover/recover-missing-semi.stderr @@ -2,29 +2,19 @@ error: expected `;`, found keyword `let` --> $DIR/recover-missing-semi.rs:2:22 | LL | let _: usize = () - | ^ + | ^ help: add `;` here ... LL | let _ = 3; | --- unexpected token - | -help: add `;` here - | -LL | let _: usize = (); - | + error: expected `;`, found keyword `return` --> $DIR/recover-missing-semi.rs:9:22 | LL | let _: usize = () - | ^ + | ^ help: add `;` here ... LL | return 3; | ------ unexpected token - | -help: add `;` here - | -LL | let _: usize = (); - | + error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 diff --git a/tests/ui/suggestions/missing-semicolon.stderr b/tests/ui/suggestions/missing-semicolon.stderr index 86404e4511c..54a64f664b5 100644 --- a/tests/ui/suggestions/missing-semicolon.stderr +++ b/tests/ui/suggestions/missing-semicolon.stderr @@ -2,27 +2,17 @@ error: expected `;`, found `}` --> $DIR/missing-semicolon.rs:6:7 | LL | () - | ^ + | ^ help: add `;` here LL | } | - unexpected token - | -help: add `;` here - | -LL | (); - | + error: expected `;`, found `}` --> $DIR/missing-semicolon.rs:32:7 | LL | () - | ^ + | ^ help: add `;` here LL | } | - unexpected token - | -help: add `;` here - | -LL | (); - | + error[E0618]: expected function, found `{integer}` --> $DIR/missing-semicolon.rs:5:13 diff --git a/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr index 3d6983ec8f9..12da91c20b3 100644 --- a/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr +++ b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr @@ -2,14 +2,9 @@ error: expected `;`, found `}` --> $DIR/suggest-semicolon-for-fn-in-extern-block.rs:6:11 | LL | fn foo() - | ^ + | ^ help: add `;` here LL | } | - unexpected token - | -help: add `;` here - | -LL | fn foo(); - | + error: aborting due to 1 previous error