Unnecessary parentheses warning for (A | B) as :pat in 2018 edition #86959
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
L-unused_parens
Lint: unused_parens
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=30f392098326a970e468c3125f7c5413
The current output is:
While it would be true that these parentheses are unnecessary in 2021 edition, (and also of course in the macro expanded output as well, which is why the warning occurs), they are required here in 2018 edition because
:pat
cannot match'a' | 'A'
in this edition, making the warning a nuisance.The text was updated successfully, but these errors were encountered: