about summary refs log tree commit diff
path: root/tests/ui/structs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-06 03:07:46 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-07-12 03:02:57 +0000
commit692bc344d55cf9d86c60b06c92a70684d013c89f (patch)
tree4ab084f04f99c13c3a5e84aeb405867bc3319f96 /tests/ui/structs
parent5e311f933d844b6922256a0c0aa49b86159534f5 (diff)
downloadrust-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/structs')
-rw-r--r--tests/ui/structs/struct-duplicate-comma.stderr11
-rw-r--r--tests/ui/structs/struct-field-init-syntax.stderr14
2 files changed, 19 insertions, 6 deletions
diff --git a/tests/ui/structs/struct-duplicate-comma.stderr b/tests/ui/structs/struct-duplicate-comma.stderr
index 4ac3fc9fe6b..dc1c6ae8716 100644
--- a/tests/ui/structs/struct-duplicate-comma.stderr
+++ b/tests/ui/structs/struct-duplicate-comma.stderr
@@ -4,10 +4,13 @@ error: expected identifier, found `,`
 LL |     let _ = Foo {
    |             --- while parsing this struct
 LL |         a: 0,,
-   |              ^
-   |              |
-   |              expected identifier
-   |              help: remove this comma
+   |              ^ expected identifier
+   |
+help: remove this comma
+   |
+LL -         a: 0,,
+LL +         a: 0,
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/structs/struct-field-init-syntax.stderr b/tests/ui/structs/struct-field-init-syntax.stderr
index 0b72c5cf734..66098d5f610 100644
--- a/tests/ui/structs/struct-field-init-syntax.stderr
+++ b/tests/ui/structs/struct-field-init-syntax.stderr
@@ -2,17 +2,27 @@ error: cannot use a comma after the base struct
   --> $DIR/struct-field-init-syntax.rs:11:9
    |
 LL |         ..Foo::default(),
-   |         ^^^^^^^^^^^^^^^^- help: remove this comma
+   |         ^^^^^^^^^^^^^^^^
    |
    = note: the base struct must always be the last field
+help: remove this comma
+   |
+LL -         ..Foo::default(),
+LL +         ..Foo::default()
+   |
 
 error: cannot use a comma after the base struct
   --> $DIR/struct-field-init-syntax.rs:16:9
    |
 LL |         ..Foo::default(),
-   |         ^^^^^^^^^^^^^^^^- help: remove this comma
+   |         ^^^^^^^^^^^^^^^^
    |
    = note: the base struct must always be the last field
+help: remove this comma
+   |
+LL -         ..Foo::default(),
+LL +         ..Foo::default()
+   |
 
 error: aborting due to 2 previous errors