about summary refs log tree commit diff
path: root/tests/ui/parser/mut-patterns.stderr
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/parser/mut-patterns.stderr
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/parser/mut-patterns.stderr')
-rw-r--r--tests/ui/parser/mut-patterns.stderr61
1 files changed, 52 insertions, 9 deletions
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