Closed
Description
This code:
pub fn repro() {
if let Some(_a) = foo() {
let _b = (foo());
}
}
fn foo() -> Option<i32> { None }
Gives unnecessary parentheses warning twice:
warning: unnecessary parentheses around assigned value
--> interpreter\src\lib.rs:3:18
|
3 | let _b = (foo());
| ^^^^^^^ help: remove these parentheses
|
= note: `#[warn(unused_parens)]` on by default
warning: unnecessary parentheses around assigned value
--> interpreter\src\lib.rs:3:18
|
3 | let _b = (foo());
| ^^^^^^^ help: remove these parentheses
warning: 2 warnings emitted
Reproduced with stable 1.54.0 and nightly 2021-08-22 af14075 on playground.