-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-or_patterns`#![feature(or_patterns)]``#![feature(or_patterns)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
#![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.
dlrobertson
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-or_patterns`#![feature(or_patterns)]``#![feature(or_patterns)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.