#![feature(or_patterns)]
#![allow(incomplete_features)]
fn foo() {
match 0 {
_a @ (0 | 1) => {}
_ => {}
}
let () = 0; // Prevent the ICE in MIR.
}
results in:
warning: unnecessary parentheses around pattern
--> src/lib.rs:6:14
|
6 | _a @ (0 | 1) => {}
| ^^^^^^^ help: remove these parentheses
|
= note: `#[warn(unused_parens)]` on by default
changing things into _a @ (0 | 1) will correctly refuse to parse.
cc @dlrobertson #54883
results in:
changing things into
_a @ (0 | 1)will correctly refuse to parse.cc @dlrobertson #54883