This commit is contained in:
Esteban Küber 2023-11-06 23:48:58 +00:00
parent bd1feb8cef
commit 147faa54d5
3 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,12 @@
// run-rustfix
fn main() {
let val = 42;
let x = match val {
0 if true => {
//~^ ERROR unexpected parentheses surrounding `match` arm pattern
42u8
}
_ => 0u8,
};
let _y: u32 = x.into(); //~ ERROR mismatched types
}

View File

@ -1,3 +1,4 @@
// run-rustfix
fn main() { fn main() {
let val = 42; let val = 42;
let x = match val { let x = match val {

View File

@ -1,5 +1,5 @@
error: unexpected parentheses surrounding `match` arm pattern error: unexpected parentheses surrounding `match` arm pattern
--> $DIR/recover-parens-around-match-arm-head.rs:4:9 --> $DIR/recover-parens-around-match-arm-head.rs:5:9
| |
LL | (0 if true) => { LL | (0 if true) => {
| ^ ^ | ^ ^
@ -11,7 +11,7 @@ LL + 0 if true => {
| |
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/recover-parens-around-match-arm-head.rs:10:19 --> $DIR/recover-parens-around-match-arm-head.rs:11:19
| |
LL | let _y: u32 = x; LL | let _y: u32 = x;
| --- ^ expected `u32`, found `u8` | --- ^ expected `u32`, found `u8`