rust/tests/ui/parser/recover/recover-parens-around-match-arm-head.rs
Esteban Küber c47318983b Account for (pat if expr) => {}
When encountering match arm (pat if expr) => {}, recover and suggest removing parentheses. Fix #100825.
2023-11-29 18:47:32 +00:00

12 lines
255 B
Rust

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; //~ ERROR mismatched types
}