about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-06-07 02:19:18 -0700
committerMichael Goulet <michael@errs.io>2022-06-07 02:19:51 -0700
commitb13eb61a2cdfac1e094c2a4d608086f40cea5e01 (patch)
tree1d1e3b23c02f50b1b2b13e39a605517365e79be2 /src/test
parent9f7e997c8bc3cacd2ab4eb75e63cb5fa9279c7b0 (diff)
downloadrust-b13eb61a2cdfac1e094c2a4d608086f40cea5e01.tar.gz
rust-b13eb61a2cdfac1e094c2a4d608086f40cea5e01.zip
Recover missing comma after match arm
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/parser/match-arm-without-braces.rs6
-rw-r--r--src/test/ui/parser/match-arm-without-braces.stderr10
2 files changed, 6 insertions, 10 deletions
diff --git a/src/test/ui/parser/match-arm-without-braces.rs b/src/test/ui/parser/match-arm-without-braces.rs
index 55a88742769..bba38fd0fa4 100644
--- a/src/test/ui/parser/match-arm-without-braces.rs
+++ b/src/test/ui/parser/match-arm-without-braces.rs
@@ -45,9 +45,9 @@ fn main() {
           15;
     }
     match S::get(16) {
-        Some(Val::Foo) => 17
-        _ => 18, //~ ERROR expected one of
-    }
+        Some(Val::Foo) => 17 //~ ERROR expected `,` following `match` arm
+        _ => 18,
+    };
     match S::get(19) {
         Some(Val::Foo) =>
           20; //~ ERROR `match` arm body without braces
diff --git a/src/test/ui/parser/match-arm-without-braces.stderr b/src/test/ui/parser/match-arm-without-braces.stderr
index 4831d79ef2b..37d55aa53f8 100644
--- a/src/test/ui/parser/match-arm-without-braces.stderr
+++ b/src/test/ui/parser/match-arm-without-braces.stderr
@@ -52,15 +52,11 @@ LL ~           { 14;
 LL ~           15; }
    |
 
-error: expected one of `,`, `.`, `?`, `}`, or an operator, found reserved identifier `_`
-  --> $DIR/match-arm-without-braces.rs:49:9
+error: expected `,` following `match` arm
+  --> $DIR/match-arm-without-braces.rs:48:29
    |
 LL |         Some(Val::Foo) => 17
-   |                        --   - expected one of `,`, `.`, `?`, `}`, or an operator
-   |                        |
-   |                        while parsing the `match` arm starting here
-LL |         _ => 18,
-   |         ^ unexpected token
+   |                             ^ help: missing a comma here to end this `match` arm: `,`
 
 error: `match` arm body without braces
   --> $DIR/match-arm-without-braces.rs:53:11