rust/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr
Esteban Küber 692bc344d5 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.
2024-07-12 03:02:57 +00:00

73 lines
1.7 KiB
Plaintext

error: expected item, found `;`
--> $DIR/recover-from-semicolon-trailing-item.rs:2:9
|
LL | mod M {};
| ^
|
= help: module declarations are not followed by a semicolon
help: remove this semicolon
|
LL - mod M {};
LL + mod M {}
|
error: expected item, found `;`
--> $DIR/recover-from-semicolon-trailing-item.rs:4:12
|
LL | struct S {};
| ^
|
= help: braced struct declarations are not followed by a semicolon
help: remove this semicolon
|
LL - struct S {};
LL + struct S {}
|
error: expected item, found `;`
--> $DIR/recover-from-semicolon-trailing-item.rs:6:20
|
LL | fn foo(a: usize) {};
| ^
|
= help: function declarations are not followed by a semicolon
help: remove this semicolon
|
LL - fn foo(a: usize) {};
LL + fn foo(a: usize) {}
|
error[E0308]: mismatched types
--> $DIR/recover-from-semicolon-trailing-item.rs:10:20
|
LL | let _: usize = S {};
| ----- ^^^^ expected `usize`, found `S`
| |
| expected due to this
error[E0308]: mismatched types
--> $DIR/recover-from-semicolon-trailing-item.rs:12:20
|
LL | let _: usize = X {};
| ----- ^^^^ expected `usize`, found `X`
| |
| expected due to this
error[E0308]: mismatched types
--> $DIR/recover-from-semicolon-trailing-item.rs:14:9
|
LL | foo("");
| --- ^^ expected `usize`, found `&str`
| |
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/recover-from-semicolon-trailing-item.rs:6:4
|
LL | fn foo(a: usize) {};
| ^^^ --------
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0308`.