Closed
Description
cc #121618.
I tried this code:
#![feature(postfix_match)]
fn main() {
(&1).match { a => a };
(1 + 2).match { b => b };
}
I expected to see this happen: no warnings
Instead, this happened:
warning: unnecessary parentheses around `match` scrutinee expression
--> src/main.rs:3:5
|
3 | (&1).match { a => a };
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
3 - (&1).match { a => a };
3 + &1.match { a => a };
|
warning: unnecessary parentheses around `match` scrutinee expression
--> src/main.rs:4:5
|
4 | (1 + 2).match { b => b };
| ^ ^
|
help: remove these parentheses
|
4 - (1 + 2).match { b => b };
4 + 1 + 2.match { b => b };
|
warning: `playground` (bin "playground") generated 2 warnings (run `cargo fix --bin "playground"` to apply 2 suggestions)
Meta
rustc --version --verbose
:
1.79.0-nightly (2024-03-24 0824b300eb0dae5d9ed5)