Closed
Description
Summary
Clippy suggests incorrect fixes for #[warn(unused_parens)]
for these patterns (the same issue with the stable 1.73.0 rustc):
let(mut _x): i8 = 0;
let( mut _x): i8 = 0;
let(_x): i8 = 0;
Reproducer
I tried this code:
fn main() {
let(mut _x): i8 = 0;
}
I expected to see this happen:
warning: unnecessary parentheses around pattern
--> src/main.rs:2:8
|
2 | let(mut _x): i8 = 0;
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
2 - let(mut _x): i8 = 0;
2 + let mut _x: i8 = 0;
|
Instead, this happened:
warning: unnecessary parentheses around pattern
--> src/main.rs:2:8
|
2 | let(mut _x): i8 = 0;
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
2 - let(mut _x): i8 = 0;
2 + letmut _x: i8 = 0;
|
Version
rustc 1.75.0-nightly (e5cfc5547 2023-10-28)
binary: rustc
commit-hash: e5cfc55477eceed1317a02189fdf77a4a98f2124
commit-date: 2023-10-28
host: x86_64-pc-windows-gnu
release: 1.75.0-nightly
LLVM version: 17.0.3
Additional Labels
No response