diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-07-06 03:07:46 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-07-12 03:02:57 +0000 |
| commit | 692bc344d55cf9d86c60b06c92a70684d013c89f (patch) | |
| tree | 4ab084f04f99c13c3a5e84aeb405867bc3319f96 /tests/ui/parser | |
| parent | 5e311f933d844b6922256a0c0aa49b86159534f5 (diff) | |
| download | rust-692bc344d55cf9d86c60b06c92a70684d013c89f.tar.gz rust-692bc344d55cf9d86c60b06c92a70684d013c89f.zip | |
Make parse error suggestions verbose and fix spans
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
Diffstat (limited to 'tests/ui/parser')
88 files changed, 1568 insertions, 344 deletions
diff --git a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr index 3593c5182ce..1ba130e20b5 100644 --- a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr +++ b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr @@ -154,9 +154,14 @@ error: outer attributes are not allowed on `if` and `else` branches | LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `if` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if 0 {}; } + | error: an inner attribute is not permitted in this context --> $DIR/attr-stmt-expr-attr-bad.rs:40:38 @@ -178,9 +183,14 @@ error: outer attributes are not allowed on `if` and `else` branches | LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; } | ---- ^^^^^^^ -- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `else` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else {}; } + | error: an inner attribute is not permitted in this context --> $DIR/attr-stmt-expr-attr-bad.rs:46:46 @@ -196,18 +206,28 @@ error: outer attributes are not allowed on `if` and `else` branches | LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; } | ---- ^^^^^^^ ------- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `else` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {}; } + | error: outer attributes are not allowed on `if` and `else` branches --> $DIR/attr-stmt-expr-attr-bad.rs:50:50 | LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `if` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {}; } + | error: an inner attribute is not permitted in this context --> $DIR/attr-stmt-expr-attr-bad.rs:52:51 @@ -223,9 +243,14 @@ error: outer attributes are not allowed on `if` and `else` branches | LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `if` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {}; } + | error: an inner attribute is not permitted in this context --> $DIR/attr-stmt-expr-attr-bad.rs:56:46 @@ -247,9 +272,14 @@ error: outer attributes are not allowed on `if` and `else` branches | LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; } | ---- ^^^^^^^ -- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `else` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {}; } + | error: an inner attribute is not permitted in this context --> $DIR/attr-stmt-expr-attr-bad.rs:62:54 @@ -265,18 +295,28 @@ error: outer attributes are not allowed on `if` and `else` branches | LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; } | ---- ^^^^^^^ --------------- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `else` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; } + | error: outer attributes are not allowed on `if` and `else` branches --> $DIR/attr-stmt-expr-attr-bad.rs:66:66 | LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `if` + | +help: remove the attributes + | +LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; } +LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; } + | error: an inner attribute is not permitted in this context --> $DIR/attr-stmt-expr-attr-bad.rs:68:67 @@ -361,9 +401,14 @@ error[E0586]: inclusive range with no end --> $DIR/attr-stmt-expr-attr-bad.rs:85:35 | LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } } - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } } +LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] 10 => () } } + | error: expected one of `=>`, `if`, or `|`, found `#` --> $DIR/attr-stmt-expr-attr-bad.rs:85:38 @@ -375,9 +420,14 @@ error[E0586]: inclusive range with no end --> $DIR/attr-stmt-expr-attr-bad.rs:88:35 | LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } } - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } } +LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] -10 => () } } + | error: expected one of `=>`, `if`, or `|`, found `#` --> $DIR/attr-stmt-expr-attr-bad.rs:88:38 @@ -395,9 +445,14 @@ error[E0586]: inclusive range with no end --> $DIR/attr-stmt-expr-attr-bad.rs:93:35 | LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } } - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } } +LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] FOO => () } } + | error: expected one of `=>`, `if`, or `|`, found `#` --> $DIR/attr-stmt-expr-attr-bad.rs:93:38 diff --git a/tests/ui/parser/bad-char-literals.stderr b/tests/ui/parser/bad-char-literals.stderr index a22ddbac1b9..89253d7d4aa 100644 --- a/tests/ui/parser/bad-char-literals.stderr +++ b/tests/ui/parser/bad-char-literals.stderr @@ -2,7 +2,12 @@ error: character constant must be escaped: `'` --> $DIR/bad-char-literals.rs:6:6 | LL | '''; - | ^ help: escape the character: `\'` + | ^ + | +help: escape the character + | +LL | '\''; + | ~~ error: character constant must be escaped: `\n` --> $DIR/bad-char-literals.rs:10:6 @@ -10,19 +15,34 @@ error: character constant must be escaped: `\n` LL | ' | ______^ LL | | '; - | |_ help: escape the character: `\n` + | |_ + | +help: escape the character + | +LL | '\n'; + | ++ error: character constant must be escaped: `\r` --> $DIR/bad-char-literals.rs:15:6 | LL | ' '; - | ^ help: escape the character: `\r` + | ^ + | +help: escape the character + | +LL | '\r'; + | ++ error: character constant must be escaped: `\t` --> $DIR/bad-char-literals.rs:18:6 | LL | ' '; - | ^^^^ help: escape the character: `\t` + | ^^^^ + | +help: escape the character + | +LL | '\t'; + | ++ error: aborting due to 4 previous errors diff --git a/tests/ui/parser/bad-fn-ptr-qualifier.stderr b/tests/ui/parser/bad-fn-ptr-qualifier.stderr index 265e31329ca..523ee47b0c9 100644 --- a/tests/ui/parser/bad-fn-ptr-qualifier.stderr +++ b/tests/ui/parser/bad-fn-ptr-qualifier.stderr @@ -5,7 +5,12 @@ LL | pub type T0 = const fn(); | -----^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type T0 = const fn(); +LL + pub type T0 = fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:6:15 @@ -14,7 +19,12 @@ LL | pub type T1 = const extern "C" fn(); | -----^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type T1 = const extern "C" fn(); +LL + pub type T1 = extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:7:15 @@ -23,7 +33,12 @@ LL | pub type T2 = const unsafe extern fn(); | -----^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type T2 = const unsafe extern fn(); +LL + pub type T2 = unsafe extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:8:15 @@ -32,7 +47,12 @@ LL | pub type T3 = async fn(); | -----^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type T3 = async fn(); +LL + pub type T3 = fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:9:15 @@ -41,7 +61,12 @@ LL | pub type T4 = async extern fn(); | -----^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type T4 = async extern fn(); +LL + pub type T4 = extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:10:15 @@ -50,7 +75,12 @@ LL | pub type T5 = async unsafe extern "C" fn(); | -----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type T5 = async unsafe extern "C" fn(); +LL + pub type T5 = unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:11:15 @@ -59,7 +89,12 @@ LL | pub type T6 = const async unsafe extern "C" fn(); | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type T6 = const async unsafe extern "C" fn(); +LL + pub type T6 = async unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:11:15 @@ -68,7 +103,12 @@ LL | pub type T6 = const async unsafe extern "C" fn(); | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type T6 = const async unsafe extern "C" fn(); +LL + pub type T6 = const unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:15:17 @@ -77,7 +117,12 @@ LL | pub type FTT0 = for<'a> const fn(); | ^^^^^^^^-----^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type FTT0 = for<'a> const fn(); +LL + pub type FTT0 = for<'a> fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:16:17 @@ -86,7 +131,12 @@ LL | pub type FTT1 = for<'a> const extern "C" fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type FTT1 = for<'a> const extern "C" fn(); +LL + pub type FTT1 = for<'a> extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:17:17 @@ -95,7 +145,12 @@ LL | pub type FTT2 = for<'a> const unsafe extern fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type FTT2 = for<'a> const unsafe extern fn(); +LL + pub type FTT2 = for<'a> unsafe extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:18:17 @@ -104,7 +159,12 @@ LL | pub type FTT3 = for<'a> async fn(); | ^^^^^^^^-----^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type FTT3 = for<'a> async fn(); +LL + pub type FTT3 = for<'a> fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:19:17 @@ -113,7 +173,12 @@ LL | pub type FTT4 = for<'a> async extern fn(); | ^^^^^^^^-----^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type FTT4 = for<'a> async extern fn(); +LL + pub type FTT4 = for<'a> extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:20:17 @@ -122,7 +187,12 @@ LL | pub type FTT5 = for<'a> async unsafe extern "C" fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type FTT5 = for<'a> async unsafe extern "C" fn(); +LL + pub type FTT5 = for<'a> unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:22:17 @@ -131,7 +201,12 @@ LL | pub type FTT6 = for<'a> const async unsafe extern "C" fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - pub type FTT6 = for<'a> const async unsafe extern "C" fn(); +LL + pub type FTT6 = for<'a> async unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:22:17 @@ -140,7 +215,12 @@ LL | pub type FTT6 = for<'a> const async unsafe extern "C" fn(); | ^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - pub type FTT6 = for<'a> const async unsafe extern "C" fn(); +LL + pub type FTT6 = for<'a> const unsafe extern "C" fn(); + | error: aborting due to 16 previous errors diff --git a/tests/ui/parser/byte-literals.stderr b/tests/ui/parser/byte-literals.stderr index 5b414c8927e..25e31995441 100644 --- a/tests/ui/parser/byte-literals.stderr +++ b/tests/ui/parser/byte-literals.stderr @@ -24,13 +24,23 @@ error: byte constant must be escaped: `\t` --> $DIR/byte-literals.rs:8:7 | LL | b' '; - | ^^^^ help: escape the character: `\t` + | ^^^^ + | +help: escape the character + | +LL | b'\t'; + | ++ error: byte constant must be escaped: `'` --> $DIR/byte-literals.rs:9:7 | LL | b'''; - | ^ help: escape the character: `\'` + | ^ + | +help: escape the character + | +LL | b'\''; + | ~~ error: non-ASCII character in byte literal --> $DIR/byte-literals.rs:10:7 diff --git a/tests/ui/parser/char/whitespace-character-literal.stderr b/tests/ui/parser/char/whitespace-character-literal.stderr index 3bd048f8f62..f273b5d61d5 100644 --- a/tests/ui/parser/char/whitespace-character-literal.stderr +++ b/tests/ui/parser/char/whitespace-character-literal.stderr @@ -2,15 +2,17 @@ error: character literal may only contain one codepoint --> $DIR/whitespace-character-literal.rs:5:30 | LL | let _hair_space_around = ' x'; - | ^--^ - | | - | help: consider removing the non-printing characters: `x` + | ^^^^ | note: there are non-printing characters, the full sequence is `\u{200a}x\u{200b}` --> $DIR/whitespace-character-literal.rs:5:31 | LL | let _hair_space_around = ' x'; | ^^ +help: consider removing the non-printing characters + | +LL | let _hair_space_around = 'x'; + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/default-on-wrong-item-kind.stderr b/tests/ui/parser/default-on-wrong-item-kind.stderr index af513f7617b..392c85e0c43 100644 --- a/tests/ui/parser/default-on-wrong-item-kind.stderr +++ b/tests/ui/parser/default-on-wrong-item-kind.stderr @@ -154,11 +154,13 @@ error: extern items cannot be `const` --> $DIR/default-on-wrong-item-kind.rs:38:19 | LL | default const foo: u8; - | --------------^^^ - | | - | help: try using a static value: `static` + | ^^^ | = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html +help: try using a static value + | +LL | static foo: u8; + | ~~~~~~ error: a module cannot be `default` --> $DIR/default-on-wrong-item-kind.rs:41:5 diff --git a/tests/ui/parser/do-catch-suggests-try.stderr b/tests/ui/parser/do-catch-suggests-try.stderr index cd8907b7eac..fd3406ae29f 100644 --- a/tests/ui/parser/do-catch-suggests-try.stderr +++ b/tests/ui/parser/do-catch-suggests-try.stderr @@ -2,9 +2,13 @@ error: found removed `do catch` syntax --> $DIR/do-catch-suggests-try.rs:4:25 | LL | let _: Option<()> = do catch {}; - | ^^^^^^^^ help: replace with the new syntax: `try` + | ^^^^^^^^ | = note: following RFC #2388, the new non-placeholder syntax is `try` +help: replace with the new syntax + | +LL | let _: Option<()> = try {}; + | ~~~ error[E0308]: mismatched types --> $DIR/do-catch-suggests-try.rs:9:33 diff --git a/tests/ui/parser/doc-comment-in-if-statement.stderr b/tests/ui/parser/doc-comment-in-if-statement.stderr index fc0bc507370..37e0c398a61 100644 --- a/tests/ui/parser/doc-comment-in-if-statement.stderr +++ b/tests/ui/parser/doc-comment-in-if-statement.stderr @@ -16,9 +16,14 @@ error: outer attributes are not allowed on `if` and `else` branches | LL | if true /*!*/ {} | -- ^^^^^ -- the attributes are attached to this branch - | | | - | | help: remove the attributes + | | | the branch belongs to this `if` + | +help: remove the attributes + | +LL - if true /*!*/ {} +LL + if true {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/expr-rarrow-call.stderr b/tests/ui/parser/expr-rarrow-call.stderr index 90082f98cb5..221e3a74d79 100644 --- a/tests/ui/parser/expr-rarrow-call.stderr +++ b/tests/ui/parser/expr-rarrow-call.stderr @@ -2,41 +2,61 @@ error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:14:10 | LL | named->foo; - | ^^ help: try using `.` instead + | ^^ | = help: the `.` operator will dereference the value if needed +help: try using `.` instead + | +LL | named.foo; + | ~ error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:18:12 | LL | unnamed->0; - | ^^ help: try using `.` instead + | ^^ | = help: the `.` operator will dereference the value if needed +help: try using `.` instead + | +LL | unnamed.0; + | ~ error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:22:6 | LL | t->0; - | ^^ help: try using `.` instead + | ^^ | = help: the `.` operator will dereference the value if needed +help: try using `.` instead + | +LL | t.0; + | ~ error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:23:6 | LL | t->1; - | ^^ help: try using `.` instead + | ^^ | = help: the `.` operator will dereference the value if needed +help: try using `.` instead + | +LL | t.1; + | ~ error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:30:8 | LL | foo->clone(); - | ^^ help: try using `.` instead + | ^^ | = help: the `.` operator will dereference the value if needed +help: try using `.` instead + | +LL | foo.clone(); + | ~ error: aborting due to 5 previous errors diff --git a/tests/ui/parser/fn-colon-return-type.stderr b/tests/ui/parser/fn-colon-return-type.stderr index b61a62a17f7..c1cdf4d4975 100644 --- a/tests/ui/parser/fn-colon-return-type.stderr +++ b/tests/ui/parser/fn-colon-return-type.stderr @@ -2,7 +2,12 @@ error: return types are denoted using `->` --> $DIR/fn-colon-return-type.rs:1:15 | LL | fn foo(x: i32): i32 { - | ^ help: use `->` instead + | ^ + | +help: use `->` instead + | +LL | fn foo(x: i32) -> i32 { + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/foreign-const-semantic-fail.stderr b/tests/ui/parser/foreign-const-semantic-fail.stderr index 8dc66c0d012..d317847f98a 100644 --- a/tests/ui/parser/foreign-const-semantic-fail.stderr +++ b/tests/ui/parser/foreign-const-semantic-fail.stderr @@ -2,21 +2,25 @@ error: extern items cannot be `const` --> $DIR/foreign-const-semantic-fail.rs:4:11 | LL | const A: isize; - | ------^ - | | - | help: try using a static value: `static` + | ^ | = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html +help: try using a static value + | +LL | static A: isize; + | ~~~~~~ error: extern items cannot be `const` --> $DIR/foreign-const-semantic-fail.rs:6:11 | LL | const B: isize = 42; - | ------^ - | | - | help: try using a static value: `static` + | ^ | = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html +help: try using a static value + | +LL | static B: isize = 42; + | ~~~~~~ error: incorrect `static` inside `extern` block --> $DIR/foreign-const-semantic-fail.rs:6:11 diff --git a/tests/ui/parser/foreign-const-syntactic-fail.stderr b/tests/ui/parser/foreign-const-syntactic-fail.stderr index 9cf58fa95fb..7da2c019022 100644 --- a/tests/ui/parser/foreign-const-syntactic-fail.stderr +++ b/tests/ui/parser/foreign-const-syntactic-fail.stderr @@ -2,21 +2,25 @@ error: extern items cannot be `const` --> $DIR/foreign-const-syntactic-fail.rs:7:11 | LL | const A: isize; - | ------^ - | | - | help: try using a static value: `static` + | ^ | = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html +help: try using a static value + | +LL | static A: isize; + | ~~~~~~ error: extern items cannot be `const` --> $DIR/foreign-const-syntactic-fail.rs:8:11 | LL | const B: isize = 42; - | ------^ - | | - | help: try using a static value: `static` + | ^ | = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html +help: try using a static value + | +LL | static B: isize = 42; + | ~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/parser/ident-recovery.stderr b/tests/ui/parser/ident-recovery.stderr index e9a55026d12..83666014eb2 100644 --- a/tests/ui/parser/ident-recovery.stderr +++ b/tests/ui/parser/ident-recovery.stderr @@ -2,19 +2,25 @@ error: expected identifier, found `,` --> $DIR/ident-recovery.rs:1:4 | LL | fn ,comma() { - | ^ - | | - | expected identifier - | help: remove this comma + | ^ expected identifier + | +help: remove this comma + | +LL - fn ,comma() { +LL + fn comma() { + | error: expected identifier, found `,` --> $DIR/ident-recovery.rs:4:16 | LL | x: i32,, - | ^ - | | - | expected identifier - | help: remove this comma + | ^ expected identifier + | +help: remove this comma + | +LL - x: i32,, +LL + x: i32, + | error: expected identifier, found keyword `break` --> $DIR/ident-recovery.rs:10:4 diff --git a/tests/ui/parser/if-in-in.stderr b/tests/ui/parser/if-in-in.stderr index 6117370c0ce..d8def76792e 100644 --- a/tests/ui/parser/if-in-in.stderr +++ b/tests/ui/parser/if-in-in.stderr @@ -2,9 +2,13 @@ error: expected iterable, found keyword `in` --> $DIR/if-in-in.rs:4:14 | LL | for i in in 1..2 { - | ---^^ - | | - | help: remove the duplicated `in` + | ^^ + | +help: remove the duplicated `in` + | +LL - for i in in 1..2 { +LL + for i in 1..2 { + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/impl-parsing.stderr b/tests/ui/parser/impl-parsing.stderr index a57cc075ccc..6a24a9453e6 100644 --- a/tests/ui/parser/impl-parsing.stderr +++ b/tests/ui/parser/impl-parsing.stderr @@ -2,13 +2,23 @@ error: missing `for` in a trait impl --> $DIR/impl-parsing.rs:4:11 | LL | impl Trait Type {} - | ^ help: add `for` here + | ^ + | +help: add `for` here + | +LL | impl Trait for Type {} + | +++ error: missing `for` in a trait impl --> $DIR/impl-parsing.rs:5:11 | LL | impl Trait .. {} - | ^ help: add `for` here + | ^ + | +help: add `for` here + | +LL | impl Trait for .. {} + | +++ error: expected a trait, found type --> $DIR/impl-parsing.rs:6:6 diff --git a/tests/ui/parser/intersection-patterns-1.stderr b/tests/ui/parser/intersection-patterns-1.stderr index dc968656c91..ed2466b21a7 100644 --- a/tests/ui/parser/intersection-patterns-1.stderr +++ b/tests/ui/parser/intersection-patterns-1.stderr @@ -6,7 +6,11 @@ LL | Some(x) @ y => {} | | | | | binding on the right, should be on the left | pattern on the left, should be on the right - | help: switch the order: `y @ Some(x)` + | +help: switch the order + | +LL | y @ Some(x) => {} + | ~~~~~~~~~~~ error: pattern on wrong side of `@` --> $DIR/intersection-patterns-1.rs:27:9 @@ -16,7 +20,11 @@ LL | 1 ..= 5 @ e => {} | | | | | binding on the right, should be on the left | pattern on the left, should be on the right - | help: switch the order: `e @ 1..=5` + | +help: switch the order + | +LL | e @ 1..=5 => {} + | ~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/fn-no-semicolon-issue-124935-semi-after-item.stderr b/tests/ui/parser/issues/fn-no-semicolon-issue-124935-semi-after-item.stderr index 9776677589f..c0d85aa17d2 100644 --- a/tests/ui/parser/issues/fn-no-semicolon-issue-124935-semi-after-item.stderr +++ b/tests/ui/parser/issues/fn-no-semicolon-issue-124935-semi-after-item.stderr @@ -2,7 +2,13 @@ error: expected item, found `;` --> $DIR/fn-no-semicolon-issue-124935-semi-after-item.rs:5:1 | LL | ; - | ^ help: remove this semicolon + | ^ + | +help: remove this semicolon + | +LL - ; +LL + + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-100197-mut-let.stderr b/tests/ui/parser/issues/issue-100197-mut-let.stderr index 07d13688140..252ed7d0715 100644 --- a/tests/ui/parser/issues/issue-100197-mut-let.stderr +++ b/tests/ui/parser/issues/issue-100197-mut-let.stderr @@ -2,7 +2,12 @@ error: invalid variable declaration --> $DIR/issue-100197-mut-let.rs:4:5 | LL | mut let _x = 123; - | ^^^^^^^ help: switch the order of `mut` and `let`: `let mut` + | ^^^^^^^ + | +help: switch the order of `mut` and `let` + | +LL | let mut _x = 123; + | ~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-101477-enum.stderr b/tests/ui/parser/issues/issue-101477-enum.stderr index 94130671f1c..c6dadeab8b3 100644 --- a/tests/ui/parser/issues/issue-101477-enum.stderr +++ b/tests/ui/parser/issues/issue-101477-enum.stderr @@ -2,9 +2,14 @@ error: unexpected `==` --> $DIR/issue-101477-enum.rs:6:7 | LL | B == 2 - | ^^ help: try using `=` instead + | ^^ | = help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` +help: try using `=` instead + | +LL - B == 2 +LL + B = 2 + | error: expected item, found `==` --> $DIR/issue-101477-enum.rs:6:7 diff --git a/tests/ui/parser/issues/issue-101477-let.stderr b/tests/ui/parser/issues/issue-101477-let.stderr index 56348357397..59e90c8102f 100644 --- a/tests/ui/parser/issues/issue-101477-let.stderr +++ b/tests/ui/parser/issues/issue-101477-let.stderr @@ -2,7 +2,13 @@ error: unexpected `==` --> $DIR/issue-101477-let.rs:4:11 | LL | let x == 2; - | ^^ help: try using `=` instead + | ^^ + | +help: try using `=` instead + | +LL - let x == 2; +LL + let x = 2; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-103425.stderr b/tests/ui/parser/issues/issue-103425.stderr index 0efe3e3ca71..e7e1b7106b0 100644 --- a/tests/ui/parser/issues/issue-103425.stderr +++ b/tests/ui/parser/issues/issue-103425.stderr @@ -2,28 +2,43 @@ 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-108109-fn-missing-params.stderr b/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr index 86d3449cc33..e5c6ba27755 100644 --- a/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr +++ b/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr @@ -2,13 +2,23 @@ error: missing parameters for function definition --> $DIR/issue-108109-fn-missing-params.rs:3:15 | LL | pub fn missing -> () {} - | ^ help: add a parameter list + | ^ + | +help: add a parameter list + | +LL | pub fn missing() -> () {} + | ++ error: missing parameters for function definition --> $DIR/issue-108109-fn-missing-params.rs:6:16 | LL | pub fn missing2 {} - | ^ help: add a parameter list + | ^ + | +help: add a parameter list + | +LL | pub fn missing2() {} + | ++ error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-113203.stderr b/tests/ui/parser/issues/issue-113203.stderr index 5db628d5977..f9c8ad91280 100644 --- a/tests/ui/parser/issues/issue-113203.stderr +++ b/tests/ui/parser/issues/issue-113203.stderr @@ -2,7 +2,12 @@ error: incorrect use of `await` --> $DIR/issue-113203.rs:5:5 | LL | await {}() - | ^^^^^^^^ help: `await` is a postfix operation: `{}.await` + | ^^^^^^^^ + | +help: `await` is a postfix operation + | +LL | {}.await() + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-118530-ice.stderr b/tests/ui/parser/issues/issue-118530-ice.stderr index 75c6a40c744..a8a2327d0ce 100644 --- a/tests/ui/parser/issues/issue-118530-ice.stderr +++ b/tests/ui/parser/issues/issue-118530-ice.stderr @@ -30,16 +30,23 @@ LL | #[feature] | ---------- only `;` terminated statements or tail expressions are allowed after this attribute LL | attr::fn bar() -> String { | ^--- unexpected token - | | - | help: add `;` here + | +help: add `;` here + | +LL | attr::fn; bar() -> String { + | + error: `->` used for field access or method call --> $DIR/issue-118530-ice.rs:5:20 | LL | attr::fn bar() -> String { - | ^^ help: try using `.` instead + | ^^ | = help: the `.` operator will dereference the value if needed +help: try using `.` instead + | +LL | attr::fn bar() . String { + | ~ error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `{` --> $DIR/issue-118530-ice.rs:5:30 diff --git a/tests/ui/parser/issues/issue-17718-const-mut.stderr b/tests/ui/parser/issues/issue-17718-const-mut.stderr index a27f517086e..54b819c3cfb 100644 --- a/tests/ui/parser/issues/issue-17718-const-mut.stderr +++ b/tests/ui/parser/issues/issue-17718-const-mut.stderr @@ -1,10 +1,13 @@ error: const globals cannot be mutable --> $DIR/issue-17718-const-mut.rs:2:1 | -LL | const - | ----- help: you might want to declare a static instead: `static` LL | mut | ^^^ cannot be mutable + | +help: you might want to declare a static instead + | +LL | static + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr b/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr index 88d97c795fc..4a3743579e7 100644 --- a/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr +++ b/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr @@ -86,9 +86,12 @@ error: incorrect unicode escape sequence --> $DIR/issue-23620-invalid-escapes.rs:32:14 | LL | let _ = "\u8f"; - | ^^^- - | | - | help: format of unicode escape sequences uses braces: `\u{8f}` + | ^^^ + | +help: format of unicode escape sequences uses braces + | +LL | let _ = "\u{8f}"; + | ~~~~~~ error: aborting due to 13 previous errors diff --git a/tests/ui/parser/issues/issue-27255.stderr b/tests/ui/parser/issues/issue-27255.stderr index 391a23556c4..2cd7ebd60b1 100644 --- a/tests/ui/parser/issues/issue-27255.stderr +++ b/tests/ui/parser/issues/issue-27255.stderr @@ -2,13 +2,23 @@ error: missing `for` in a trait impl --> $DIR/issue-27255.rs:3:7 | LL | impl A .. {} - | ^ help: add `for` here + | ^ + | +help: add `for` here + | +LL | impl A for .. {} + | +++ error: missing `for` in a trait impl --> $DIR/issue-27255.rs:7:7 | LL | impl A usize {} - | ^^^^^^ help: add `for` here + | ^^^^^^ + | +help: add `for` here + | +LL | impl A for usize {} + | +++ error: `impl Trait for .. {}` is an obsolete syntax --> $DIR/issue-27255.rs:3:1 diff --git a/tests/ui/parser/issues/issue-3036.stderr b/tests/ui/parser/issues/issue-3036.stderr index 3dd89b7e828..62a9c1d9752 100644 --- a/tests/ui/parser/issues/issue-3036.stderr +++ b/tests/ui/parser/issues/issue-3036.stderr @@ -2,9 +2,14 @@ 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-32501.stderr b/tests/ui/parser/issues/issue-32501.stderr index c0513a64039..b0ec135b784 100644 --- a/tests/ui/parser/issues/issue-32501.stderr +++ b/tests/ui/parser/issues/issue-32501.stderr @@ -2,9 +2,14 @@ error: `mut` must be followed by a named binding --> $DIR/issue-32501.rs:7:9 | LL | let mut _ = 0; - | ^^^^ help: remove the `mut` prefix + | ^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: remove the `mut` prefix + | +LL - let mut _ = 0; +LL + let _ = 0; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-46186.stderr b/tests/ui/parser/issues/issue-46186.stderr index c67c271e19a..5ea3e1f4983 100644 --- a/tests/ui/parser/issues/issue-46186.stderr +++ b/tests/ui/parser/issues/issue-46186.stderr @@ -2,9 +2,14 @@ error: expected item, found `;` --> $DIR/issue-46186.rs:5:2 | LL | }; - | ^ help: remove this semicolon + | ^ | = help: braced struct declarations are not followed by a semicolon +help: remove this semicolon + | +LL - }; +LL + } + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-48636.stderr b/tests/ui/parser/issues/issue-48636.stderr index 488a046a549..c17a8ec2f89 100644 --- a/tests/ui/parser/issues/issue-48636.stderr +++ b/tests/ui/parser/issues/issue-48636.stderr @@ -4,11 +4,14 @@ error[E0585]: found a documentation comment that doesn't document anything LL | struct S { | - while parsing this struct LL | x: u8 - | - help: missing comma here: `,` LL | /// The ID of the parent core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: doc comments must come before what they document, if a comment was intended use `//` +help: missing comma here + | +LL | x: u8, + | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-49040.stderr b/tests/ui/parser/issues/issue-49040.stderr index 11ef5e1aadf..c25d5683ecf 100644 --- a/tests/ui/parser/issues/issue-49040.stderr +++ b/tests/ui/parser/issues/issue-49040.stderr @@ -2,7 +2,13 @@ error: expected item, found `;` --> $DIR/issue-49040.rs:1:28 | LL | #![allow(unused_variables)]; - | ^ help: remove this semicolon + | ^ + | +help: remove this semicolon + | +LL - #![allow(unused_variables)]; +LL + #![allow(unused_variables)] + | error[E0601]: `main` function not found in crate `issue_49040` --> $DIR/issue-49040.rs:2:12 diff --git a/tests/ui/parser/issues/issue-52496.stderr b/tests/ui/parser/issues/issue-52496.stderr index 78c81bf5b0d..a97effb4e0c 100644 --- a/tests/ui/parser/issues/issue-52496.stderr +++ b/tests/ui/parser/issues/issue-52496.stderr @@ -2,7 +2,12 @@ error: float literals must have an integer part --> $DIR/issue-52496.rs:4:24 | LL | let _ = Foo { bar: .5, baz: 42 }; - | ^^ help: must have an integer part: `0.5` + | ^^ + | +help: must have an integer part + | +LL | let _ = Foo { bar: 0.5, baz: 42 }; + | + error: expected one of `,`, `:`, or `}`, found `.` --> $DIR/issue-52496.rs:8:22 diff --git a/tests/ui/parser/issues/issue-54521-2.stderr b/tests/ui/parser/issues/issue-54521-2.stderr index 9556b83b730..ad662ef1cca 100644 --- a/tests/ui/parser/issues/issue-54521-2.stderr +++ b/tests/ui/parser/issues/issue-54521-2.stderr @@ -2,25 +2,49 @@ error: unmatched angle brackets --> $DIR/issue-54521-2.rs:11:25 | LL | let _ = Vec::<usize>>>>>::new(); - | ^^^^ help: remove extra angle brackets + | ^^^^ + | +help: remove extra angle brackets + | +LL - let _ = Vec::<usize>>>>>::new(); +LL + let _ = Vec::<usize>::new(); + | error: unmatched angle brackets --> $DIR/issue-54521-2.rs:14:25 | LL | let _ = Vec::<usize>>>>::new(); - | ^^^ help: remove extra angle brackets + | ^^^ + | +help: remove extra angle brackets + | +LL - let _ = Vec::<usize>>>>::new(); +LL + let _ = Vec::<usize>::new(); + | error: unmatched angle brackets --> $DIR/issue-54521-2.rs:17:25 | LL | let _ = Vec::<usize>>>::new(); - | ^^ help: remove extra angle brackets + | ^^ + | +help: remove extra angle brackets + | +LL - let _ = Vec::<usize>>>::new(); +LL + let _ = Vec::<usize>::new(); + | error: unmatched angle bracket --> $DIR/issue-54521-2.rs:20:25 | LL | let _ = Vec::<usize>>::new(); - | ^ help: remove extra angle bracket + | ^ + | +help: remove extra angle bracket + | +LL - let _ = Vec::<usize>>::new(); +LL + let _ = Vec::<usize>::new(); + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/issues/issue-54521-3.stderr b/tests/ui/parser/issues/issue-54521-3.stderr index 0f23dd62107..bd468869b06 100644 --- a/tests/ui/parser/issues/issue-54521-3.stderr +++ b/tests/ui/parser/issues/issue-54521-3.stderr @@ -2,25 +2,49 @@ error: unmatched angle brackets --> $DIR/issue-54521-3.rs:11:60 | LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>>(); - | ^^^^ help: remove extra angle brackets + | ^^^^ + | +help: remove extra angle brackets + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: unmatched angle brackets --> $DIR/issue-54521-3.rs:14:60 | LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>(); - | ^^^ help: remove extra angle brackets + | ^^^ + | +help: remove extra angle brackets + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: unmatched angle brackets --> $DIR/issue-54521-3.rs:17:60 | LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>(); - | ^^ help: remove extra angle brackets + | ^^ + | +help: remove extra angle brackets + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: unmatched angle bracket --> $DIR/issue-54521-3.rs:20:60 | LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>(); - | ^ help: remove extra angle bracket + | ^ + | +help: remove extra angle bracket + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/issues/issue-57684.stderr b/tests/ui/parser/issues/issue-57684.stderr index 514bbffde6b..39e1c8cd7cc 100644 --- a/tests/ui/parser/issues/issue-57684.stderr +++ b/tests/ui/parser/issues/issue-57684.stderr @@ -2,17 +2,23 @@ error: expected `:`, found `=` --> $DIR/issue-57684.rs:27:20 | LL | let _ = X { f1 = 5 }; - | -^ - | | - | help: replace equals symbol with a colon: `:` + | ^ + | +help: replace equals symbol with a colon + | +LL | let _ = X { f1: 5 }; + | ~ error: expected `:`, found `=` --> $DIR/issue-57684.rs:32:12 | LL | f1 = 5, - | -^ - | | - | help: replace equals symbol with a colon: `:` + | ^ + | +help: replace equals symbol with a colon + | +LL | f1: 5, + | ~ error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-57819.stderr b/tests/ui/parser/issues/issue-57819.stderr index 493e9835b1c..a01625d9c4c 100644 --- a/tests/ui/parser/issues/issue-57819.stderr +++ b/tests/ui/parser/issues/issue-57819.stderr @@ -2,43 +2,85 @@ error: unmatched angle brackets --> $DIR/issue-57819.rs:19:10 | LL | bar::<<<<<T as Foo>::Output>(); - | ^^^ help: remove extra angle brackets + | ^^^ + | +help: remove extra angle brackets + | +LL - bar::<<<<<T as Foo>::Output>(); +LL + bar::<<T as Foo>::Output>(); + | error: unmatched angle brackets --> $DIR/issue-57819.rs:22:10 | LL | bar::<<<<T as Foo>::Output>(); - | ^^ help: remove extra angle brackets + | ^^ + | +help: remove extra angle brackets + | +LL - bar::<<<<T as Foo>::Output>(); +LL + bar::<<T as Foo>::Output>(); + | error: unmatched angle bracket --> $DIR/issue-57819.rs:25:10 | LL | bar::<<<T as Foo>::Output>(); - | ^ help: remove extra angle bracket + | ^ + | +help: remove extra angle bracket + | +LL - bar::<<<T as Foo>::Output>(); +LL + bar::<<T as Foo>::Output>(); + | error: unmatched angle brackets --> $DIR/issue-57819.rs:34:48 | LL | let _ = vec![1, 2, 3].into_iter().collect::<<<<<Vec<usize>>(); - | ^^^^ help: remove extra angle brackets + | ^^^^ + | +help: remove extra angle brackets + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<<<<<Vec<usize>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: unmatched angle brackets --> $DIR/issue-57819.rs:37:48 | LL | let _ = vec![1, 2, 3].into_iter().collect::<<<<Vec<usize>>(); - | ^^^ help: remove extra angle brackets + | ^^^ + | +help: remove extra angle brackets + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<<<<Vec<usize>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: unmatched angle brackets --> $DIR/issue-57819.rs:40:48 | LL | let _ = vec![1, 2, 3].into_iter().collect::<<<Vec<usize>>(); - | ^^ help: remove extra angle brackets + | ^^ + | +help: remove extra angle brackets + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<<<Vec<usize>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: unmatched angle bracket --> $DIR/issue-57819.rs:43:48 | LL | let _ = vec![1, 2, 3].into_iter().collect::<<Vec<usize>>(); - | ^ help: remove extra angle bracket + | ^ + | +help: remove extra angle bracket + | +LL - let _ = vec![1, 2, 3].into_iter().collect::<<Vec<usize>>(); +LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>(); + | error: aborting due to 7 previous errors diff --git a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr index 2bd87ee0c38..76259b40a93 100644 --- a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr +++ b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr @@ -2,13 +2,18 @@ error: `mut` must be followed by a named binding --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:6:13 | LL | let mut $eval = (); - | ^^^^ help: remove the `mut` prefix + | ^^^^ ... LL | mac1! { does_not_exist!() } | --------------------------- in this macro invocation | = note: `mut` may be followed by `variable` and `variable @ pattern` = note: this error originates in the macro `mac1` (in Nightly builds, run with -Z macro-backtrace for more info) +help: remove the `mut` prefix + | +LL - let mut $eval = (); +LL + let $eval = (); + | error: expected identifier, found `does_not_exist!()` --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:17 @@ -25,13 +30,18 @@ error: `mut` must be followed by a named binding --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:13 | LL | let mut $eval = (); - | ^^^ help: remove the `mut` prefix + | ^^^ ... LL | mac2! { does_not_exist!() } | --------------------------- in this macro invocation | = note: `mut` may be followed by `variable` and `variable @ pattern` = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) +help: remove the `mut` prefix + | +LL - let mut $eval = (); +LL + let $eval = (); + | error: cannot find macro `does_not_exist` in this scope --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:22:13 diff --git a/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr b/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr index 0a88dd2c4d3..49d091cf391 100644 --- a/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr +++ b/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr @@ -46,13 +46,23 @@ error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5 | LL | mut n = 0; - | ^^^ help: missing keyword: `let mut` + | ^^^ + | +help: missing keyword + | +LL | let mut n = 0; + | ~~~~~~~ error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5 | LL | mut var; - | ^^^ help: missing keyword: `let mut` + | ^^^ + | +help: missing keyword + | +LL | let mut var; + | ~~~~~~~ error[E0308]: mismatched types --> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33 diff --git a/tests/ui/parser/issues/issue-70388-recover-dotdotdot-rest-pat.stderr b/tests/ui/parser/issues/issue-70388-recover-dotdotdot-rest-pat.stderr index 4961e8fc049..63131b474f0 100644 --- a/tests/ui/parser/issues/issue-70388-recover-dotdotdot-rest-pat.stderr +++ b/tests/ui/parser/issues/issue-70388-recover-dotdotdot-rest-pat.stderr @@ -2,19 +2,25 @@ error: unexpected `...` --> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:4:13 | LL | let Foo(...) = Foo(0); - | ^^^ - | | - | not a valid pattern - | help: for a rest pattern, use `..` instead of `...` + | ^^^ not a valid pattern + | +help: for a rest pattern, use `..` instead of `...` + | +LL - let Foo(...) = Foo(0); +LL + let Foo(..) = Foo(0); + | error: unexpected `...` --> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:5:13 | LL | let [_, ..., _] = [0, 1]; - | ^^^ - | | - | not a valid pattern - | help: for a rest pattern, use `..` instead of `...` + | ^^^ not a valid pattern + | +help: for a rest pattern, use `..` instead of `...` + | +LL - let [_, ..., _] = [0, 1]; +LL + let [_, .., _] = [0, 1]; + | error[E0308]: mismatched types --> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:6:33 diff --git a/tests/ui/parser/issues/issue-70388-without-witness.stderr b/tests/ui/parser/issues/issue-70388-without-witness.stderr index b750ad4c626..ed78377607d 100644 --- a/tests/ui/parser/issues/issue-70388-without-witness.stderr +++ b/tests/ui/parser/issues/issue-70388-without-witness.stderr @@ -2,19 +2,25 @@ error: unexpected `...` --> $DIR/issue-70388-without-witness.rs:7:13 | LL | let Foo(...) = Foo(0); - | ^^^ - | | - | not a valid pattern - | help: for a rest pattern, use `..` instead of `...` + | ^^^ not a valid pattern + | +help: for a rest pattern, use `..` instead of `...` + | +LL - let Foo(...) = Foo(0); +LL + let Foo(..) = Foo(0); + | error: unexpected `...` --> $DIR/issue-70388-without-witness.rs:8:13 | LL | let [_, ..., _] = [0, 1]; - | ^^^ - | | - | not a valid pattern - | help: for a rest pattern, use `..` instead of `...` + | ^^^ not a valid pattern + | +help: for a rest pattern, use `..` instead of `...` + | +LL - let [_, ..., _] = [0, 1]; +LL + let [_, .., _] = [0, 1]; + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr b/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr index ec0af9a6caf..79c574ead61 100644 --- a/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr +++ b/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr @@ -17,7 +17,13 @@ error: unexpected lifetime `'static` in pattern --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:13 | LL | fn bar(&'static mur Self) {} - | ^^^^^^^ help: remove the lifetime + | ^^^^^^^ + | +help: remove the lifetime + | +LL - fn bar(&'static mur Self) {} +LL + fn bar(&mur Self) {} + | error: expected identifier, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25 diff --git a/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr b/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr index 652aeff5dd4..2f8728bd78b 100644 --- a/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr +++ b/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr @@ -2,24 +2,38 @@ error: lifetime must precede `mut` --> $DIR/issue-73568-lifetime-after-mut.rs:2:13 | LL | fn x<'a>(x: &mut 'a i32){} - | ^^^^^^^ help: place the lifetime before `mut`: `&'a mut` + | ^^^^^^^ + | +help: place the lifetime before `mut` + | +LL | fn x<'a>(x: &'a mut i32){} + | ~~~~~~~ error[E0178]: expected a path on the left-hand side of `+`, not `&mut 'a` --> $DIR/issue-73568-lifetime-after-mut.rs:14:13 | LL | fn y<'a>(y: &mut 'a + Send) { - | ^^^^^^^^^^^^^^ help: try adding parentheses: `&mut ('a + Send)` + | ^^^^^^^^^^^^^^ + | +help: try adding parentheses + | +LL | fn y<'a>(y: &mut ('a + Send)) { + | + + error: lifetime must precede `mut` --> $DIR/issue-73568-lifetime-after-mut.rs:6:22 | LL | fn w<$lt>(w: &mut $lt i32) {} - | ^^^^^^^^ help: place the lifetime before `mut`: `&$lt mut` + | ^^^^^^^^ ... LL | mac!('a); | -------- in this macro invocation | = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) +help: place the lifetime before `mut` + | +LL | fn w<$lt>(w: &$lt mut i32) {} + | ~~~~~~~~ error[E0423]: expected value, found trait `Send` --> $DIR/issue-73568-lifetime-after-mut.rs:17:28 diff --git a/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr b/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr index 57772de1e7a..874e7b07163 100644 --- a/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr +++ b/tests/ui/parser/issues/issue-87197-missing-semicolon.stderr @@ -2,25 +2,40 @@ 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/issues/issue-89574.stderr b/tests/ui/parser/issues/issue-89574.stderr index a0586d41e2e..aa5e66b18a9 100644 --- a/tests/ui/parser/issues/issue-89574.stderr +++ b/tests/ui/parser/issues/issue-89574.stderr @@ -8,7 +8,12 @@ error: missing type for `const` item --> $DIR/issue-89574.rs:2:22 | LL | const EMPTY_ARRAY = []; - | ^ help: provide a type for the item: `: <type>` + | ^ + | +help: provide a type for the item + | +LL | const EMPTY_ARRAY: <type> = []; + | ++++++++ error[E0282]: type annotations needed --> $DIR/issue-89574.rs:2:25 diff --git a/tests/ui/parser/issues/issue-90993.stderr b/tests/ui/parser/issues/issue-90993.stderr index ab6bce410e6..a18e93f1f1a 100644 --- a/tests/ui/parser/issues/issue-90993.stderr +++ b/tests/ui/parser/issues/issue-90993.stderr @@ -17,9 +17,13 @@ error: unexpected `=` after inclusive range --> $DIR/issue-90993.rs:2:5 | LL | ...=. - | ^^^^ help: use `..=` instead + | ^^^^ | = note: inclusive ranges end with a single equals sign (`..=`) +help: use `..=` instead + | +LL | ..=. + | ~~~ error: expected one of `-`, `;`, `}`, or path, found `.` --> $DIR/issue-90993.rs:2:9 diff --git a/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr index c503bc3ccfc..c98b8fa1f1e 100644 --- a/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr +++ b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr @@ -2,7 +2,12 @@ error: `enum` and `struct` are mutually exclusive --> $DIR/issue-99625-enum-struct-mutually-exclusive.rs:3:5 | LL | pub enum struct Range { - | ^^^^^^^^^^^ help: replace `enum struct` with: `enum` + | ^^^^^^^^^^^ + | +help: replace `enum struct` with + | +LL | pub enum Range { + | ~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr index 72377fc379c..1ccf44a350d 100644 --- a/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr +++ b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr @@ -2,13 +2,23 @@ error: `const` and `let` are mutually exclusive --> $DIR/issue-99910-const-let-mutually-exclusive.rs:4:5 | LL | const let _FOO: i32 = 123; - | ^^^^^^^^^ help: remove `let`: `const` + | ^^^^^^^^^ + | +help: remove `let` + | +LL | const _FOO: i32 = 123; + | ~~~~~ error: `const` and `let` are mutually exclusive --> $DIR/issue-99910-const-let-mutually-exclusive.rs:6:5 | LL | let const _BAR: i32 = 123; - | ^^^^^^^^^ help: remove `let`: `const` + | ^^^^^^^^^ + | +help: remove `let` + | +LL | const _BAR: i32 = 123; + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/missing-main-issue-124935-semi-after-item.stderr b/tests/ui/parser/issues/missing-main-issue-124935-semi-after-item.stderr index 2d7f540443d..8d4f2368386 100644 --- a/tests/ui/parser/issues/missing-main-issue-124935-semi-after-item.stderr +++ b/tests/ui/parser/issues/missing-main-issue-124935-semi-after-item.stderr @@ -2,9 +2,14 @@ error: expected item, found `;` --> $DIR/missing-main-issue-124935-semi-after-item.rs:5:1 | LL | ; - | ^ help: remove this semicolon + | ^ | = help: function declarations are not followed by a semicolon +help: remove this semicolon + | +LL - ; +LL + + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/item-free-const-no-body-semantic-fail.stderr b/tests/ui/parser/item-free-const-no-body-semantic-fail.stderr index 5365b0a1f82..1ecf9912e9b 100644 --- a/tests/ui/parser/item-free-const-no-body-semantic-fail.stderr +++ b/tests/ui/parser/item-free-const-no-body-semantic-fail.stderr @@ -18,7 +18,12 @@ error: missing type for `const` item --> $DIR/item-free-const-no-body-semantic-fail.rs:6:8 | LL | const B; - | ^ help: provide a type for the item: `: <type>` + | ^ + | +help: provide a type for the item + | +LL | const B: <type>; + | ++++++++ error: aborting due to 3 previous errors diff --git a/tests/ui/parser/item-free-static-no-body-semantic-fail.stderr b/tests/ui/parser/item-free-static-no-body-semantic-fail.stderr index 1b61e430546..3af7c642468 100644 --- a/tests/ui/parser/item-free-static-no-body-semantic-fail.stderr +++ b/tests/ui/parser/item-free-static-no-body-semantic-fail.stderr @@ -34,13 +34,23 @@ error: missing type for `static` item --> $DIR/item-free-static-no-body-semantic-fail.rs:6:9 | LL | static B; - | ^ help: provide a type for the item: `: <type>` + | ^ + | +help: provide a type for the item + | +LL | static B: <type>; + | ++++++++ error: missing type for `static mut` item --> $DIR/item-free-static-no-body-semantic-fail.rs:10:13 | LL | static mut D; - | ^ help: provide a type for the item: `: <type>` + | ^ + | +help: provide a type for the item + | +LL | static mut D: <type>; + | ++++++++ error: aborting due to 6 previous errors diff --git a/tests/ui/parser/item-kw-case-mismatch.stderr b/tests/ui/parser/item-kw-case-mismatch.stderr index ba59ea85363..0abc59e064a 100644 --- a/tests/ui/parser/item-kw-case-mismatch.stderr +++ b/tests/ui/parser/item-kw-case-mismatch.stderr @@ -2,85 +2,155 @@ error: keyword `use` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:7:1 | LL | Use std::ptr::read; - | ^^^ help: write it in the correct case (notice the capitalization): `use` + | ^^^ + | +help: write it in the correct case (notice the capitalization difference) + | +LL | use std::ptr::read; + | ~~~ error: keyword `use` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:8:1 | LL | USE std::ptr::write; - | ^^^ help: write it in the correct case: `use` + | ^^^ + | +help: write it in the correct case + | +LL | use std::ptr::write; + | ~~~ error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:10:7 | LL | async Fn _a() {} - | ^^ help: write it in the correct case (notice the capitalization): `fn` + | ^^ + | +help: write it in the correct case (notice the capitalization difference) + | +LL | async fn _a() {} + | ~~ error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:13:1 | LL | Fn _b() {} - | ^^ help: write it in the correct case (notice the capitalization): `fn` + | ^^ + | +help: write it in the correct case (notice the capitalization difference) + | +LL | fn _b() {} + | ~~ error: keyword `async` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:16:1 | LL | aSYNC fN _c() {} - | ^^^^^ help: write it in the correct case: `async` + | ^^^^^ + | +help: write it in the correct case + | +LL | async fN _c() {} + | ~~~~~ error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:16:7 | LL | aSYNC fN _c() {} - | ^^ help: write it in the correct case: `fn` + | ^^ + | +help: write it in the correct case + | +LL | aSYNC fn _c() {} + | ~~ error: keyword `async` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:20:1 | LL | Async fn _d() {} - | ^^^^^ help: write it in the correct case: `async` + | ^^^^^ + | +help: write it in the correct case + | +LL | async fn _d() {} + | ~~~~~ error: keyword `const` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:23:1 | LL | CONST UNSAFE FN _e() {} - | ^^^^^ help: write it in the correct case: `const` + | ^^^^^ + | +help: write it in the correct case + | +LL | const UNSAFE FN _e() {} + | ~~~~~ error: keyword `unsafe` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:23:7 | LL | CONST UNSAFE FN _e() {} - | ^^^^^^ help: write it in the correct case: `unsafe` + | ^^^^^^ + | +help: write it in the correct case + | +LL | CONST unsafe FN _e() {} + | ~~~~~~ error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:23:14 | LL | CONST UNSAFE FN _e() {} - | ^^ help: write it in the correct case: `fn` + | ^^ + | +help: write it in the correct case + | +LL | CONST UNSAFE fn _e() {} + | ~~ error: keyword `unsafe` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:28:1 | LL | unSAFE EXTern fn _f() {} - | ^^^^^^ help: write it in the correct case: `unsafe` + | ^^^^^^ + | +help: write it in the correct case + | +LL | unsafe EXTern fn _f() {} + | ~~~~~~ error: keyword `extern` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:28:8 | LL | unSAFE EXTern fn _f() {} - | ^^^^^^ help: write it in the correct case: `extern` + | ^^^^^^ + | +help: write it in the correct case + | +LL | unSAFE extern fn _f() {} + | ~~~~~~ error: keyword `extern` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:32:1 | LL | EXTERN "C" FN _g() {} - | ^^^^^^ help: write it in the correct case: `extern` + | ^^^^^^ + | +help: write it in the correct case + | +LL | extern "C" FN _g() {} + | ~~~~~~ error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:32:12 | LL | EXTERN "C" FN _g() {} - | ^^ help: write it in the correct case: `fn` + | ^^ + | +help: write it in the correct case + | +LL | EXTERN "C" fn _g() {} + | ~~ error: aborting due to 14 previous errors diff --git a/tests/ui/parser/label-after-block-like.stderr b/tests/ui/parser/label-after-block-like.stderr index 8ff50b124b3..be8c679d8ce 100644 --- a/tests/ui/parser/label-after-block-like.stderr +++ b/tests/ui/parser/label-after-block-like.stderr @@ -2,12 +2,15 @@ error: labeled expression must be followed by `:` --> $DIR/label-after-block-like.rs:2:20 | LL | if let () = () 'a {} - | ---^^ - | | | - | | help: add `:` after the label + | --^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | if let () = () 'a: {} + | + error: expected `{`, found `'a` --> $DIR/label-after-block-like.rs:2:20 @@ -29,12 +32,15 @@ error: labeled expression must be followed by `:` --> $DIR/label-after-block-like.rs:8:13 | LL | if true 'a {} - | ---^^ - | | | - | | help: add `:` after the label + | --^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | if true 'a: {} + | + error: expected `{`, found `'a` --> $DIR/label-after-block-like.rs:8:13 @@ -56,12 +62,15 @@ error: labeled expression must be followed by `:` --> $DIR/label-after-block-like.rs:14:10 | LL | loop 'a {} - | ---^^ - | | | - | | help: add `:` after the label + | --^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | loop 'a: {} + | + error: expected `{`, found `'a` --> $DIR/label-after-block-like.rs:14:10 @@ -80,12 +89,15 @@ error: labeled expression must be followed by `:` --> $DIR/label-after-block-like.rs:20:16 | LL | while true 'a {} - | ---^^ - | | | - | | help: add `:` after the label + | --^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | while true 'a: {} + | + error: expected `{`, found `'a` --> $DIR/label-after-block-like.rs:20:16 @@ -105,12 +117,15 @@ error: labeled expression must be followed by `:` --> $DIR/label-after-block-like.rs:26:23 | LL | while let () = () 'a {} - | ---^^ - | | | - | | help: add `:` after the label + | --^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | while let () = () 'a: {} + | + error: expected `{`, found `'a` --> $DIR/label-after-block-like.rs:26:23 @@ -130,12 +145,15 @@ error: labeled expression must be followed by `:` --> $DIR/label-after-block-like.rs:32:19 | LL | for _ in 0..0 'a {} - | ---^^ - | | | - | | help: add `:` after the label + | --^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | for _ in 0..0 'a: {} + | + error: expected `{`, found `'a` --> $DIR/label-after-block-like.rs:32:19 @@ -152,12 +170,15 @@ error: labeled expression must be followed by `:` --> $DIR/label-after-block-like.rs:38:12 | LL | unsafe 'a {} - | ---^^ - | | | - | | help: add `:` after the label + | --^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | unsafe 'a: {} + | + error: expected `{`, found `'a` --> $DIR/label-after-block-like.rs:38:12 diff --git a/tests/ui/parser/labeled-no-colon-expr.stderr b/tests/ui/parser/labeled-no-colon-expr.stderr index 4d61d9c1403..24783192815 100644 --- a/tests/ui/parser/labeled-no-colon-expr.stderr +++ b/tests/ui/parser/labeled-no-colon-expr.stderr @@ -2,45 +2,57 @@ error: labeled expression must be followed by `:` --> $DIR/labeled-no-colon-expr.rs:2:5 | LL | 'l0 while false {} - | ----^^^^^^^^^^^^^^ - | | | - | | help: add `:` after the label + | ---^^^^^^^^^^^^^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | 'l0: while false {} + | + error: labeled expression must be followed by `:` --> $DIR/labeled-no-colon-expr.rs:3:5 | LL | 'l1 for _ in 0..1 {} - | ----^^^^^^^^^^^^^^^^ - | | | - | | help: add `:` after the label + | ---^^^^^^^^^^^^^^^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | 'l1: for _ in 0..1 {} + | + error: labeled expression must be followed by `:` --> $DIR/labeled-no-colon-expr.rs:4:5 | LL | 'l2 loop {} - | ----^^^^^^^ - | | | - | | help: add `:` after the label + | ---^^^^^^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | 'l2: loop {} + | + error: labeled expression must be followed by `:` --> $DIR/labeled-no-colon-expr.rs:5:5 | LL | 'l3 {} - | ----^^ - | | | - | | help: add `:` after the label + | ---^^^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | 'l3: {} + | + error: expected `while`, `for`, `loop` or `{` after a label --> $DIR/labeled-no-colon-expr.rs:6:9 @@ -58,12 +70,15 @@ error: labeled expression must be followed by `:` --> $DIR/labeled-no-colon-expr.rs:6:9 | LL | 'l4 0; - | ----^ - | | | - | | help: add `:` after the label + | --- ^ + | | | the label | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | 'l4: 0; + | + error: cannot use a `block` macro fragment here --> $DIR/labeled-no-colon-expr.rs:11:17 @@ -86,14 +101,16 @@ error: labeled expression must be followed by `:` --> $DIR/labeled-no-colon-expr.rs:14:8 | LL | 'l5 $b; - | ---- help: add `:` after the label - | | - | the label + | --- the label ... LL | m!({}); | ^^ | = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them +help: add `:` after the label + | +LL | 'l5: $b; + | + error: aborting due to 8 previous errors diff --git a/tests/ui/parser/let-binop.stderr b/tests/ui/parser/let-binop.stderr index dd33e9157cf..50ef14793cd 100644 --- a/tests/ui/parser/let-binop.stderr +++ b/tests/ui/parser/let-binop.stderr @@ -2,25 +2,40 @@ error: can't reassign to an uninitialized variable --> $DIR/let-binop.rs:4:15 | LL | let a: i8 *= 1; - | ^^ help: initialize the variable + | ^^ | = help: if you meant to overwrite, remove the `let` binding +help: initialize the variable + | +LL - let a: i8 *= 1; +LL + let a: i8 = 1; + | error: can't reassign to an uninitialized variable --> $DIR/let-binop.rs:6:11 | LL | let b += 1; - | ^^ help: initialize the variable + | ^^ | = help: if you meant to overwrite, remove the `let` binding +help: initialize the variable + | +LL - let b += 1; +LL + let b = 1; + | error: can't reassign to an uninitialized variable --> $DIR/let-binop.rs:8:11 | LL | let c *= 1; - | ^^ help: initialize the variable + | ^^ | = help: if you meant to overwrite, remove the `let` binding +help: initialize the variable + | +LL - let c *= 1; +LL + let c = 1; + | error: aborting due to 3 previous errors diff --git a/tests/ui/parser/lifetime-in-pattern-recover.stderr b/tests/ui/parser/lifetime-in-pattern-recover.stderr index 4bf7f57bfb5..d0644da1dd1 100644 --- a/tests/ui/parser/lifetime-in-pattern-recover.stderr +++ b/tests/ui/parser/lifetime-in-pattern-recover.stderr @@ -2,13 +2,25 @@ error: unexpected lifetime `'a` in pattern --> $DIR/lifetime-in-pattern-recover.rs:2:10 | LL | let &'a x = &0; - | ^^ help: remove the lifetime + | ^^ + | +help: remove the lifetime + | +LL - let &'a x = &0; +LL + let &x = &0; + | error: unexpected lifetime `'a` in pattern --> $DIR/lifetime-in-pattern-recover.rs:3:10 | LL | let &'a mut y = &mut 0; - | ^^ help: remove the lifetime + | ^^ + | +help: remove the lifetime + | +LL - let &'a mut y = &mut 0; +LL + let &mut y = &mut 0; + | error[E0308]: mismatched types --> $DIR/lifetime-in-pattern-recover.rs:5:33 diff --git a/tests/ui/parser/lifetime-in-pattern.stderr b/tests/ui/parser/lifetime-in-pattern.stderr index a1d721e746a..55f9e56a429 100644 --- a/tests/ui/parser/lifetime-in-pattern.stderr +++ b/tests/ui/parser/lifetime-in-pattern.stderr @@ -2,7 +2,13 @@ error: unexpected lifetime `'a` in pattern --> $DIR/lifetime-in-pattern.rs:1:10 | LL | fn test(&'a str) { - | ^^ help: remove the lifetime + | ^^ + | +help: remove the lifetime + | +LL - fn test(&'a str) { +LL + fn test(&str) { + | error: expected one of `:`, `@`, or `|`, found `)` --> $DIR/lifetime-in-pattern.rs:1:16 diff --git a/tests/ui/parser/macro/pub-item-macro.stderr b/tests/ui/parser/macro/pub-item-macro.stderr index 9a2fffcced5..14f0b0908d1 100644 --- a/tests/ui/parser/macro/pub-item-macro.stderr +++ b/tests/ui/parser/macro/pub-item-macro.stderr @@ -2,13 +2,18 @@ error: can't qualify macro invocation with `pub` --> $DIR/pub-item-macro.rs:10:5 | LL | pub priv_x!(); - | ^^^ help: remove the visibility + | ^^^ ... LL | pub_x!(); | -------- in this macro invocation | = help: try adjusting the macro to put `pub` inside the invocation = note: this error originates in the macro `pub_x` (in Nightly builds, run with -Z macro-backtrace for more info) +help: remove the visibility + | +LL - pub priv_x!(); +LL + priv_x!(); + | error[E0603]: static `x` is private --> $DIR/pub-item-macro.rs:20:23 diff --git a/tests/ui/parser/macros-no-semicolon.stderr b/tests/ui/parser/macros-no-semicolon.stderr index f310662dbb0..4cf01e457d7 100644 --- a/tests/ui/parser/macros-no-semicolon.stderr +++ b/tests/ui/parser/macros-no-semicolon.stderr @@ -2,17 +2,27 @@ 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/match-arm-without-body.stderr b/tests/ui/parser/match-arm-without-body.stderr index a3f7e32c177..53cf3480dbf 100644 --- a/tests/ui/parser/match-arm-without-body.stderr +++ b/tests/ui/parser/match-arm-without-body.stderr @@ -56,7 +56,12 @@ error: expected `,` following `match` arm --> $DIR/match-arm-without-body.rs:66:15 | LL | pat!() - | ^ help: missing a comma here to end this `match` arm: `,` + | ^ + | +help: missing a comma here to end this `match` arm + | +LL | pat!(), + | + error: `match` arm with no body --> $DIR/match-arm-without-body.rs:7:9 diff --git a/tests/ui/parser/match-arm-without-braces.stderr b/tests/ui/parser/match-arm-without-braces.stderr index ee1c8e562fc..4a4a154d860 100644 --- a/tests/ui/parser/match-arm-without-braces.stderr +++ b/tests/ui/parser/match-arm-without-braces.stderr @@ -60,7 +60,12 @@ error: expected `,` following `match` arm --> $DIR/match-arm-without-braces.rs:48:29 | LL | Some(Val::Foo) => 17 - | ^ help: missing a comma here to end this `match` arm: `,` + | ^ + | +help: missing a comma here to end this `match` arm + | +LL | Some(Val::Foo) => 17, + | + error: `match` arm body without braces --> $DIR/match-arm-without-braces.rs:53:11 diff --git a/tests/ui/parser/mut-patterns.stderr b/tests/ui/parser/mut-patterns.stderr index 6559cf09cdf..f4f11b88d36 100644 --- a/tests/ui/parser/mut-patterns.stderr +++ b/tests/ui/parser/mut-patterns.stderr @@ -2,53 +2,87 @@ error: `mut` must be followed by a named binding --> $DIR/mut-patterns.rs:9:9 | LL | let mut _ = 0; - | ^^^^ help: remove the `mut` prefix + | ^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: remove the `mut` prefix + | +LL - let mut _ = 0; +LL + let _ = 0; + | error: `mut` must be followed by a named binding --> $DIR/mut-patterns.rs:10:9 | LL | let mut (_, _) = (0, 0); - | ^^^^ help: remove the `mut` prefix + | ^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: remove the `mut` prefix + | +LL - let mut (_, _) = (0, 0); +LL + let (_, _) = (0, 0); + | error: `mut` must be attached to each individual binding --> $DIR/mut-patterns.rs:12:9 | LL | let mut (x @ y) = 0; - | ^^^^^^^^^^^ help: add `mut` to each binding: `(mut x @ mut y)` + | ^^^^^^^^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: add `mut` to each binding + | +LL | let (mut x @ mut y) = 0; + | ~~~~~~~~~~~~~~~ error: `mut` on a binding may not be repeated --> $DIR/mut-patterns.rs:14:13 | LL | let mut mut x = 0; - | ^^^ help: remove the additional `mut`s + | ^^^ + | +help: remove the additional `mut`s + | +LL - let mut mut x = 0; +LL + let mut x = 0; + | error: `mut` must be attached to each individual binding --> $DIR/mut-patterns.rs:19:9 | LL | let mut Foo { x: x } = Foo { x: 3 }; - | ^^^^^^^^^^^^^^^^ help: add `mut` to each binding: `Foo { x: mut x }` + | ^^^^^^^^^^^^^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: add `mut` to each binding + | +LL | let Foo { x: mut x } = Foo { x: 3 }; + | ~~~~~~~~~~~~~~~~ error: `mut` must be attached to each individual binding --> $DIR/mut-patterns.rs:23:9 | LL | let mut Foo { x } = Foo { x: 3 }; - | ^^^^^^^^^^^^^ help: add `mut` to each binding: `Foo { mut x }` + | ^^^^^^^^^^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: add `mut` to each binding + | +LL | let Foo { mut x } = Foo { x: 3 }; + | ~~~~~~~~~~~~~ error: `mut` on a binding may not be repeated --> $DIR/mut-patterns.rs:28:13 | LL | let mut mut yield(become, await) = r#yield(0, 0); - | ^^^ help: remove the additional `mut`s + | ^^^ + | +help: remove the additional `mut`s + | +LL - let mut mut yield(become, await) = r#yield(0, 0); +LL + let mut yield(become, await) = r#yield(0, 0); + | error: expected identifier, found reserved keyword `yield` --> $DIR/mut-patterns.rs:28:17 @@ -87,17 +121,26 @@ error: `mut` must be followed by a named binding --> $DIR/mut-patterns.rs:28:9 | LL | let mut mut yield(become, await) = r#yield(0, 0); - | ^^^^^^^^ help: remove the `mut` prefix + | ^^^^^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: remove the `mut` prefix + | +LL - let mut mut yield(become, await) = r#yield(0, 0); +LL + let yield(become, await) = r#yield(0, 0); + | error: `mut` must be attached to each individual binding --> $DIR/mut-patterns.rs:37:9 | LL | let mut W(mut a, W(b, W(ref c, W(d, B { box f })))) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `mut` to each binding: `W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f }))))` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: add `mut` to each binding + | +LL | let W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f })))) + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: expected identifier, found `x` --> $DIR/mut-patterns.rs:44:21 diff --git a/tests/ui/parser/not-a-pred.stderr b/tests/ui/parser/not-a-pred.stderr index bcc64a687fd..6f6a332cb81 100644 --- a/tests/ui/parser/not-a-pred.stderr +++ b/tests/ui/parser/not-a-pred.stderr @@ -2,7 +2,12 @@ error: return types are denoted using `->` --> $DIR/not-a-pred.rs:1:26 | LL | fn f(a: isize, b: isize) : lt(a, b) { } - | ^ help: use `->` instead + | ^ + | +help: use `->` instead + | +LL | fn f(a: isize, b: isize) -> lt(a, b) { } + | ~~ error[E0573]: expected type, found function `lt` --> $DIR/not-a-pred.rs:1:28 diff --git a/tests/ui/parser/pat-recover-wildcards.stderr b/tests/ui/parser/pat-recover-wildcards.stderr index 2b0c9bbc5be..e36ff237bb0 100644 --- a/tests/ui/parser/pat-recover-wildcards.stderr +++ b/tests/ui/parser/pat-recover-wildcards.stderr @@ -32,9 +32,14 @@ error[E0586]: inclusive range with no end --> $DIR/pat-recover-wildcards.rs:35:10 | LL | 0..._ => () - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - 0..._ => () +LL + 0.._ => () + | error: expected one of `=>`, `if`, or `|`, found reserved identifier `_` --> $DIR/pat-recover-wildcards.rs:35:13 diff --git a/tests/ui/parser/pub-method-macro.stderr b/tests/ui/parser/pub-method-macro.stderr index 35cbf423079..2e2c30dc6ad 100644 --- a/tests/ui/parser/pub-method-macro.stderr +++ b/tests/ui/parser/pub-method-macro.stderr @@ -2,9 +2,14 @@ error: can't qualify macro invocation with `pub` --> $DIR/pub-method-macro.rs:17:9 | LL | pub defn!(f); - | ^^^ help: remove the visibility + | ^^^ | = help: try adjusting the macro to put `pub` inside the invocation +help: remove the visibility + | +LL - pub defn!(f); +LL + defn!(f); + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/range-inclusive-extra-equals.stderr b/tests/ui/parser/range-inclusive-extra-equals.stderr index 83df719dd3c..a573cdf950c 100644 --- a/tests/ui/parser/range-inclusive-extra-equals.stderr +++ b/tests/ui/parser/range-inclusive-extra-equals.stderr @@ -2,9 +2,13 @@ error: unexpected `=` after inclusive range --> $DIR/range-inclusive-extra-equals.rs:7:13 | LL | if let 1..==3 = 1 {} - | ^^^^ help: use `..=` instead + | ^^^^ | = note: inclusive ranges end with a single equals sign (`..=`) +help: use `..=` instead + | +LL | if let 1..=3 = 1 {} + | ~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/range_inclusive.stderr b/tests/ui/parser/range_inclusive.stderr index 0fd7f28db31..014f95bcd84 100644 --- a/tests/ui/parser/range_inclusive.stderr +++ b/tests/ui/parser/range_inclusive.stderr @@ -2,9 +2,14 @@ error[E0586]: inclusive range with no end --> $DIR/range_inclusive.rs:5:15 | LL | for _ in 1..= {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - for _ in 1..= {} +LL + for _ in 1.. {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/raw/raw-str-unbalanced.stderr b/tests/ui/parser/raw/raw-str-unbalanced.stderr index eac8c06c1df..d3a9c342c03 100644 --- a/tests/ui/parser/raw/raw-str-unbalanced.stderr +++ b/tests/ui/parser/raw/raw-str-unbalanced.stderr @@ -19,10 +19,15 @@ 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-const-async-fn-ptr.stderr b/tests/ui/parser/recover/recover-const-async-fn-ptr.stderr index 7012096b644..8e5b76163ad 100644 --- a/tests/ui/parser/recover/recover-const-async-fn-ptr.stderr +++ b/tests/ui/parser/recover/recover-const-async-fn-ptr.stderr @@ -5,7 +5,12 @@ LL | type T0 = const fn(); | -----^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type T0 = const fn(); +LL + type T0 = fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:4:11 @@ -14,7 +19,12 @@ LL | type T1 = const extern "C" fn(); | -----^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type T1 = const extern "C" fn(); +LL + type T1 = extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:5:11 @@ -23,7 +33,12 @@ LL | type T2 = const unsafe extern fn(); | -----^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type T2 = const unsafe extern fn(); +LL + type T2 = unsafe extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:6:11 @@ -32,7 +47,12 @@ LL | type T3 = async fn(); | -----^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type T3 = async fn(); +LL + type T3 = fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:7:11 @@ -41,7 +61,12 @@ LL | type T4 = async extern fn(); | -----^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type T4 = async extern fn(); +LL + type T4 = extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:8:11 @@ -50,7 +75,12 @@ LL | type T5 = async unsafe extern "C" fn(); | -----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type T5 = async unsafe extern "C" fn(); +LL + type T5 = unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:9:11 @@ -59,7 +89,12 @@ LL | type T6 = const async unsafe extern "C" fn(); | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type T6 = const async unsafe extern "C" fn(); +LL + type T6 = async unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:9:11 @@ -68,7 +103,12 @@ LL | type T6 = const async unsafe extern "C" fn(); | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type T6 = const async unsafe extern "C" fn(); +LL + type T6 = const unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:13:12 @@ -77,7 +117,12 @@ LL | type FT0 = for<'a> const fn(); | ^^^^^^^^-----^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type FT0 = for<'a> const fn(); +LL + type FT0 = for<'a> fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:14:12 @@ -86,7 +131,12 @@ LL | type FT1 = for<'a> const extern "C" fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type FT1 = for<'a> const extern "C" fn(); +LL + type FT1 = for<'a> extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:15:12 @@ -95,7 +145,12 @@ LL | type FT2 = for<'a> const unsafe extern fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type FT2 = for<'a> const unsafe extern fn(); +LL + type FT2 = for<'a> unsafe extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:16:12 @@ -104,7 +159,12 @@ LL | type FT3 = for<'a> async fn(); | ^^^^^^^^-----^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type FT3 = for<'a> async fn(); +LL + type FT3 = for<'a> fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:17:12 @@ -113,7 +173,12 @@ LL | type FT4 = for<'a> async extern fn(); | ^^^^^^^^-----^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type FT4 = for<'a> async extern fn(); +LL + type FT4 = for<'a> extern fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:18:12 @@ -122,7 +187,12 @@ LL | type FT5 = for<'a> async unsafe extern "C" fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type FT5 = for<'a> async unsafe extern "C" fn(); +LL + type FT5 = for<'a> unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:19:12 @@ -131,7 +201,12 @@ LL | type FT6 = for<'a> const async unsafe extern "C" fn(); | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this - | help: remove the `const` qualifier + | +help: remove the `const` qualifier + | +LL - type FT6 = for<'a> const async unsafe extern "C" fn(); +LL + type FT6 = for<'a> async unsafe extern "C" fn(); + | error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:19:12 @@ -140,7 +215,12 @@ LL | type FT6 = for<'a> const async unsafe extern "C" fn(); | ^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this - | help: remove the `async` qualifier + | +help: remove the `async` qualifier + | +LL - type FT6 = for<'a> const async unsafe extern "C" fn(); +LL + type FT6 = for<'a> const unsafe extern "C" fn(); + | error[E0308]: mismatched types --> $DIR/recover-const-async-fn-ptr.rs:24:33 diff --git a/tests/ui/parser/recover/recover-field-extra-angle-brackets-in-struct-with-a-field.stderr b/tests/ui/parser/recover/recover-field-extra-angle-brackets-in-struct-with-a-field.stderr index 2b56498c50d..68d57f20bd7 100644 --- a/tests/ui/parser/recover/recover-field-extra-angle-brackets-in-struct-with-a-field.stderr +++ b/tests/ui/parser/recover/recover-field-extra-angle-brackets-in-struct-with-a-field.stderr @@ -1,11 +1,14 @@ error: unmatched angle bracket --> $DIR/recover-field-extra-angle-brackets-in-struct-with-a-field.rs:2:25 | -LL | next: Option<String>> - | _________________________^ -LL | | -LL | | } - | |_ help: remove extra angle bracket +LL | next: Option<String>> + | ^ + | +help: remove extra angle bracket + | +LL - next: Option<String>> +LL + next: Option<String> + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/recover/recover-field-extra-angle-brackets.stderr b/tests/ui/parser/recover/recover-field-extra-angle-brackets.stderr index 628626926a7..45af6313391 100644 --- a/tests/ui/parser/recover/recover-field-extra-angle-brackets.stderr +++ b/tests/ui/parser/recover/recover-field-extra-angle-brackets.stderr @@ -2,7 +2,13 @@ error: unmatched angle bracket --> $DIR/recover-field-extra-angle-brackets.rs:5:19 | LL | first: Vec<u8>>, - | ^ help: remove extra angle bracket + | ^ + | +help: remove extra angle bracket + | +LL - first: Vec<u8>>, +LL + first: Vec<u8>, + | error: aborting due to 1 previous error 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 61c43f2f189..8a87d44c959 100644 --- a/tests/ui/parser/recover/recover-missing-semi-before-item.stderr +++ b/tests/ui/parser/recover/recover-missing-semi-before-item.stderr @@ -2,82 +2,132 @@ 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 ba479828538..3e8cb37160e 100644 --- a/tests/ui/parser/recover/recover-missing-semi.stderr +++ b/tests/ui/parser/recover/recover-missing-semi.stderr @@ -2,19 +2,29 @@ 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/parser/recover/recover-range-pats.stderr b/tests/ui/parser/recover/recover-range-pats.stderr index e29b6c1c666..b8e91c2344a 100644 --- a/tests/ui/parser/recover/recover-range-pats.stderr +++ b/tests/ui/parser/recover/recover-range-pats.stderr @@ -2,196 +2,330 @@ error: float literals must have an integer part --> $DIR/recover-range-pats.rs:20:12 | LL | if let .0..Y = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let 0.0..Y = 0 {} + | + error: float literals must have an integer part --> $DIR/recover-range-pats.rs:22:16 | LL | if let X.. .0 = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let X.. 0.0 = 0 {} + | + error: float literals must have an integer part --> $DIR/recover-range-pats.rs:33:12 | LL | if let .0..=Y = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let 0.0..=Y = 0 {} + | + error: float literals must have an integer part --> $DIR/recover-range-pats.rs:35:16 | LL | if let X..=.0 = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let X..=0.0 = 0 {} + | + error: float literals must have an integer part --> $DIR/recover-range-pats.rs:58:12 | LL | if let .0...Y = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let 0.0...Y = 0 {} + | + error: float literals must have an integer part --> $DIR/recover-range-pats.rs:62:17 | LL | if let X... .0 = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let X... 0.0 = 0 {} + | + error: float literals must have an integer part --> $DIR/recover-range-pats.rs:73:12 | LL | if let .0.. = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let 0.0.. = 0 {} + | + error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:79:13 | LL | if let 0..= = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let 0..= = 0 {} +LL + if let 0.. = 0 {} + | error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:80:13 | LL | if let X..= = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let X..= = 0 {} +LL + if let X.. = 0 {} + | error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:81:16 | LL | if let true..= = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let true..= = 0 {} +LL + if let true.. = 0 {} + | error: float literals must have an integer part --> $DIR/recover-range-pats.rs:83:12 | LL | if let .0..= = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let 0.0..= = 0 {} + | + error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:83:14 | LL | if let .0..= = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let .0..= = 0 {} +LL + if let .0.. = 0 {} + | error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:89:13 | LL | if let 0... = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let 0... = 0 {} +LL + if let 0.. = 0 {} + | error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:90:13 | LL | if let X... = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let X... = 0 {} +LL + if let X.. = 0 {} + | error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:91:16 | LL | if let true... = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let true... = 0 {} +LL + if let true.. = 0 {} + | error: float literals must have an integer part --> $DIR/recover-range-pats.rs:93:12 | LL | if let .0... = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let 0.0... = 0 {} + | + error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:93:14 | LL | if let .0... = 0 {} - | ^^^ help: use `..` instead + | ^^^ | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) +help: use `..` instead + | +LL - if let .0... = 0 {} +LL + if let .0.. = 0 {} + | error: float literals must have an integer part --> $DIR/recover-range-pats.rs:103:15 | LL | if let .. .0 = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let .. 0.0 = 0 {} + | + error: float literals must have an integer part --> $DIR/recover-range-pats.rs:113:15 | LL | if let ..=.0 = 0 {} - | ^^ help: must have an integer part: `0.0` + | ^^ + | +help: must have an integer part + | +LL | if let ..=0.0 = 0 {} + | + error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:119:12 | LL | if let ...3 = 0 {} - | ^^^ help: use `..=` instead + | ^^^ + | +help: use `..=` instead + | +LL | if let ..=3 = 0 {} + | ~~~ error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:121:12 | LL | if let ...Y = 0 {} - | ^^^ help: use `..=` instead + | ^^^ + | +help: use `..=` instead + | +LL | if let ..=Y = 0 {} + | ~~~ error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:123:12 | LL | if let ...true = 0 {} - | ^^^ help: use `..=` instead + | ^^^ + | +help: use `..=` instead + | +LL | if let ..=true = 0 {} + | ~~~ error: float literals must have an integer part --> $DIR/recover-range-pats.rs:126:15 | LL | if let ....3 = 0 {} - | ^^ help: must have an integer part: `0.3` + | ^^ + | +help: must have an integer part + | +LL | if let ...0.3 = 0 {} + | + error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:126:12 | LL | if let ....3 = 0 {} - | ^^^ help: use `..=` instead + | ^^^ + | +help: use `..=` instead + | +LL | if let ..=.3 = 0 {} + | ~~~ error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:152:17 | LL | let ...$e; - | ^^^ help: use `..=` instead + | ^^^ ... LL | mac!(0); | ------- in this macro invocation | = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use `..=` instead + | +LL | let ..=$e; + | ~~~ error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:159:19 | LL | let $e...; - | ^^^ help: use `..` instead + | ^^^ ... LL | mac!(0); | ------- in this macro invocation | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use `..` instead + | +LL - let $e...; +LL + let $e..; + | error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:161:19 | LL | let $e..=; - | ^^^ help: use `..` instead + | ^^^ ... LL | mac!(0); | ------- in this macro invocation | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use `..` instead + | +LL - let $e..=; +LL + let $e..; + | error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:40:13 diff --git a/tests/ui/parser/recover/recover-ref-dyn-mut.stderr b/tests/ui/parser/recover/recover-ref-dyn-mut.stderr index c048c8ea1b0..bb0f0b0214c 100644 --- a/tests/ui/parser/recover/recover-ref-dyn-mut.stderr +++ b/tests/ui/parser/recover/recover-ref-dyn-mut.stderr @@ -2,7 +2,12 @@ error: `mut` must precede `dyn` --> $DIR/recover-ref-dyn-mut.rs:5:12 | LL | let r: &dyn mut Trait; - | ^^^^^^^^ help: place `mut` before `dyn`: `&mut dyn` + | ^^^^^^^^ + | +help: place `mut` before `dyn` + | +LL | let r: &mut dyn Trait; + | ~~~~~~~~ error[E0405]: cannot find trait `Trait` in this scope --> $DIR/recover-ref-dyn-mut.rs:5:21 diff --git a/tests/ui/parser/recover/recover-unticked-labels.stderr b/tests/ui/parser/recover/recover-unticked-labels.stderr index fbd108ca613..5cf463677af 100644 --- a/tests/ui/parser/recover/recover-unticked-labels.stderr +++ b/tests/ui/parser/recover/recover-unticked-labels.stderr @@ -2,17 +2,23 @@ error: expected a label, found an identifier --> $DIR/recover-unticked-labels.rs:5:26 | LL | 'label: loop { break label 0 }; - | -^^^^ - | | - | help: labels start with a tick + | ^^^^^ + | +help: labels start with a tick + | +LL | 'label: loop { break 'label 0 }; + | + error: expected a label, found an identifier --> $DIR/recover-unticked-labels.rs:6:29 | LL | 'label: loop { continue label }; - | -^^^^ - | | - | help: labels start with a tick + | ^^^^^ + | +help: labels start with a tick + | +LL | 'label: loop { continue 'label }; + | + error[E0425]: cannot find value `label` in this scope --> $DIR/recover-unticked-labels.rs:4:26 diff --git a/tests/ui/parser/regions-out-of-scope-slice.stderr b/tests/ui/parser/regions-out-of-scope-slice.stderr index 5d8f6af166b..838dcde2850 100644 --- a/tests/ui/parser/regions-out-of-scope-slice.stderr +++ b/tests/ui/parser/regions-out-of-scope-slice.stderr @@ -2,10 +2,15 @@ error: borrow expressions cannot be annotated with lifetimes --> $DIR/regions-out-of-scope-slice.rs:7:13 | LL | x = &'blk [1,2,3]; - | ^----^^^^^^^^ + | ^-----^^^^^^^ | | | annotated with lifetime here - | help: remove the lifetime annotation + | +help: remove the lifetime annotation + | +LL - x = &'blk [1,2,3]; +LL + x = &[1,2,3]; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr b/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr index c089e0ba969..0cdee1d51ea 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-fn-sigil.stderr @@ -2,7 +2,12 @@ error: missing parameters for function definition --> $DIR/removed-syntax-fn-sigil.rs:2:14 | LL | let x: fn~() = || (); - | ^ help: add a parameter list + | ^ + | +help: add a parameter list + | +LL | let x: fn()~() = || (); + | ++ error: expected one of `->`, `;`, or `=`, found `~` --> $DIR/removed-syntax-fn-sigil.rs:2:14 diff --git a/tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr b/tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr index 52e0658949d..d3ed7fc6376 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-static-fn.stderr @@ -19,7 +19,12 @@ error: missing type for `static` item --> $DIR/removed-syntax-static-fn.rs:4:14 | LL | static fn f() {} - | ^ help: provide a type for the item: `: <type>` + | ^ + | +help: provide a type for the item + | +LL | static fn: <type> f() {} + | ++++++++ error: aborting due to 3 previous errors diff --git a/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr b/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr index 7f16ebcfc3a..1fb57ab11f9 100644 --- a/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr +++ b/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr @@ -2,37 +2,73 @@ error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:9:16 | LL | field1: i32 = 42, - | ^^^^^ help: remove this unsupported default value + | ^^^^^ + | +help: remove this unsupported default value + | +LL - field1: i32 = 42, +LL + field1: i32, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:10:14 | LL | field2: E = E::A, - | ^^^^^^^ help: remove this unsupported default value + | ^^^^^^^ + | +help: remove this unsupported default value + | +LL - field2: E = E::A, +LL + field2: E, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:11:16 | LL | field3: i32 = 1 + 2, - | ^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field3: i32 = 1 + 2, +LL + field3: i32, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:12:16 | LL | field4: i32 = { 1 + 2 }, - | ^^^^^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field4: i32 = { 1 + 2 }, +LL + field4: i32, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:13:14 | LL | field5: E = foo(42), - | ^^^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field5: E = foo(42), +LL + field5: E, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:14:14 | LL | field6: E = { foo(42) }, - | ^^^^^^^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field6: E = { foo(42) }, +LL + field6: E, + | error: expected `,`, or `}`, found `field2` --> $DIR/struct-default-values-and-missing-field-separator.rs:18:16 @@ -50,25 +86,49 @@ error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:20:16 | LL | field3: i32 = 1 + 2, - | ^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field3: i32 = 1 + 2, +LL + field3: i32, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:21:16 | LL | field4: i32 = { 1 + 2 }, - | ^^^^^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field4: i32 = { 1 + 2 }, +LL + field4: i32, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:22:14 | LL | field5: E = foo(42), - | ^^^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field5: E = foo(42), +LL + field5: E, + | error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:23:14 | LL | field6: E = { foo(42) }, - | ^^^^^^^^^^^^^^ help: remove this unsupported default value + | ^^^^^^^^^^^^^^ + | +help: remove this unsupported default value + | +LL - field6: E = { foo(42) }, +LL + field6: E, + | error: expected `:`, found `=` --> $DIR/struct-default-values-and-missing-field-separator.rs:27:12 diff --git a/tests/ui/parser/trait-object-delimiters.stderr b/tests/ui/parser/trait-object-delimiters.stderr index 5f175e86545..be130ac7ab2 100644 --- a/tests/ui/parser/trait-object-delimiters.stderr +++ b/tests/ui/parser/trait-object-delimiters.stderr @@ -2,7 +2,12 @@ error: ambiguous `+` in a type --> $DIR/trait-object-delimiters.rs:3:13 | LL | fn foo1(_: &dyn Drop + AsRef<str>) {} - | ^^^^^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(dyn Drop + AsRef<str>)` + | ^^^^^^^^^^^^^^^^^^^^^ + | +help: try adding parentheses + | +LL | fn foo1(_: &(dyn Drop + AsRef<str>)) {} + | + + error: incorrect parentheses around trait bounds --> $DIR/trait-object-delimiters.rs:6:17 @@ -52,9 +57,14 @@ error: invalid `dyn` keyword --> $DIR/trait-object-delimiters.rs:16:25 | LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {} - | ^^^ help: remove this keyword + | ^^^ | = help: `dyn` is only needed at the start of a trait `+`-separated list +help: remove this keyword + | +LL - fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {} +LL + fn foo5(_: &(dyn Drop + AsRef<str>)) {} + | error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/trait-object-delimiters.rs:3:24 diff --git a/tests/ui/parser/trait-object-lifetime-parens.stderr b/tests/ui/parser/trait-object-lifetime-parens.stderr index 9c7a9662c40..280c0e40c64 100644 --- a/tests/ui/parser/trait-object-lifetime-parens.stderr +++ b/tests/ui/parser/trait-object-lifetime-parens.stderr @@ -2,13 +2,25 @@ error: parenthesized lifetime bounds are not supported --> $DIR/trait-object-lifetime-parens.rs:5:21 | LL | fn f<'a, T: Trait + ('a)>() {} - | ^^^^ help: remove the parentheses + | ^^^^ + | +help: remove the parentheses + | +LL - fn f<'a, T: Trait + ('a)>() {} +LL + fn f<'a, T: Trait + 'a>() {} + | error: parenthesized lifetime bounds are not supported --> $DIR/trait-object-lifetime-parens.rs:8:24 | LL | let _: Box<Trait + ('a)>; - | ^^^^ help: remove the parentheses + | ^^^^ + | +help: remove the parentheses + | +LL - let _: Box<Trait + ('a)>; +LL + let _: Box<Trait + 'a>; + | error: lifetime in trait object type must be followed by `+` --> $DIR/trait-object-lifetime-parens.rs:10:17 diff --git a/tests/ui/parser/trait-object-polytrait-priority.rs b/tests/ui/parser/trait-object-polytrait-priority.rs index 63425f3e201..e7f085104ae 100644 --- a/tests/ui/parser/trait-object-polytrait-priority.rs +++ b/tests/ui/parser/trait-object-polytrait-priority.rs @@ -6,5 +6,4 @@ fn main() { let _: &for<'a> Trait<'a> + 'static; //~^ ERROR expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>` //~| HELP try adding parentheses - //~| SUGGESTION &(for<'a> Trait<'a> + 'static) } diff --git a/tests/ui/parser/trait-object-polytrait-priority.stderr b/tests/ui/parser/trait-object-polytrait-priority.stderr index 23ec1e9cf3d..8cb564e7930 100644 --- a/tests/ui/parser/trait-object-polytrait-priority.stderr +++ b/tests/ui/parser/trait-object-polytrait-priority.stderr @@ -2,7 +2,12 @@ error[E0178]: expected a path on the left-hand side of `+`, not `&for<'a> Trait< --> $DIR/trait-object-polytrait-priority.rs:6:12 | LL | let _: &for<'a> Trait<'a> + 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&(for<'a> Trait<'a> + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: try adding parentheses + | +LL | let _: &(for<'a> Trait<'a> + 'static); + | + + error: aborting due to 1 previous error diff --git a/tests/ui/parser/unicode-character-literal.stderr b/tests/ui/parser/unicode-character-literal.stderr index 726cde2b413..a1561e7f04b 100644 --- a/tests/ui/parser/unicode-character-literal.stderr +++ b/tests/ui/parser/unicode-character-literal.stderr @@ -34,15 +34,17 @@ error: character literal may only contain one codepoint --> $DIR/unicode-character-literal.rs:17:14 | LL | let _a = 'Å'; - | ^-^ - | | - | help: consider using the normalized form `\u{c5}` of this character: `Å` + | ^^^ | note: this `A` is followed by the combining mark `\u{30a}` --> $DIR/unicode-character-literal.rs:17:15 | LL | let _a = 'Å'; | ^ +help: consider using the normalized form `\u{c5}` of this character + | +LL | let _a = 'Å'; + | ~ error: aborting due to 3 previous errors diff --git a/tests/ui/parser/unmatched-langle-1.stderr b/tests/ui/parser/unmatched-langle-1.stderr index cdf74bdedc2..3411a05fb58 100644 --- a/tests/ui/parser/unmatched-langle-1.stderr +++ b/tests/ui/parser/unmatched-langle-1.stderr @@ -2,7 +2,13 @@ error: unmatched angle brackets --> $DIR/unmatched-langle-1.rs:5:10 | LL | foo::<<<<Ty<i32>>(); - | ^^^ help: remove extra angle brackets + | ^^^ + | +help: remove extra angle brackets + | +LL - foo::<<<<Ty<i32>>(); +LL + foo::<Ty<i32>>(); + | error[E0412]: cannot find type `Ty` in this scope --> $DIR/unmatched-langle-1.rs:5:14 diff --git a/tests/ui/parser/unnecessary-let.stderr b/tests/ui/parser/unnecessary-let.stderr index 952119cae3e..c6ac0d562f8 100644 --- a/tests/ui/parser/unnecessary-let.stderr +++ b/tests/ui/parser/unnecessary-let.stderr @@ -2,19 +2,36 @@ error: expected pattern, found `let` --> $DIR/unnecessary-let.rs:2:9 | LL | for let x of [1, 2, 3] {} - | ^^^ help: remove the unnecessary `let` keyword + | ^^^ + | +help: remove the unnecessary `let` keyword + | +LL - for let x of [1, 2, 3] {} +LL + for x of [1, 2, 3] {} + | error: missing `in` in `for` loop --> $DIR/unnecessary-let.rs:2:15 | LL | for let x of [1, 2, 3] {} - | ^^ help: try using `in` here instead + | ^^ + | +help: try using `in` here instead + | +LL | for let x in [1, 2, 3] {} + | ~~ error: expected pattern, found `let` --> $DIR/unnecessary-let.rs:7:9 | LL | let 1 => {} - | ^^^ help: remove the unnecessary `let` keyword + | ^^^ + | +help: remove the unnecessary `let` keyword + | +LL - let 1 => {} +LL + 1 => {} + | error: aborting due to 3 previous errors diff --git a/tests/ui/parser/use-colon-as-mod-sep.stderr b/tests/ui/parser/use-colon-as-mod-sep.stderr index bfc5374ef9d..347b271df99 100644 --- a/tests/ui/parser/use-colon-as-mod-sep.stderr +++ b/tests/ui/parser/use-colon-as-mod-sep.stderr @@ -2,33 +2,49 @@ error: expected `::`, found `:` --> $DIR/use-colon-as-mod-sep.rs:3:17 | LL | use std::process:Command; - | ^ help: use double colon + | ^ | = note: import paths are delimited using `::` +help: use double colon + | +LL | use std::process::Command; + | ~~ error: expected `::`, found `:` --> $DIR/use-colon-as-mod-sep.rs:5:8 | LL | use std:fs::File; - | ^ help: use double colon + | ^ | = note: import paths are delimited using `::` +help: use double colon + | +LL | use std::fs::File; + | ~~ error: expected `::`, found `:` --> $DIR/use-colon-as-mod-sep.rs:7:8 | LL | use std:collections:HashMap; - | ^ help: use double colon + | ^ | = note: import paths are delimited using `::` +help: use double colon + | +LL | use std::collections:HashMap; + | ~~ error: expected `::`, found `:` --> $DIR/use-colon-as-mod-sep.rs:7:20 | LL | use std:collections:HashMap; - | ^ help: use double colon + | ^ | = note: import paths are delimited using `::` +help: use double colon + | +LL | use std:collections::HashMap; + | ~~ error: aborting due to 4 previous errors |
