or_patterns: unused_parens
lints erroneously on _a @ (0 | 1)
(original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Assignees
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.
Metadata
Metadata
Labels
Development
No branches or pull requests