rust/tests/ui/lint/issue-103435-extra-parentheses.rs
Esteban Küber 0ff331bc78 Change how for (x in foo) {} is handled
Use the same approach used for match arm patterns.
2023-11-29 18:47:32 +00:00

18 lines
399 B
Rust

// run-rustfix
#![deny(unused_parens)]
fn main() {
if let(Some(_))= Some(1) {}
//~^ ERROR unnecessary parentheses around pattern
for(_x)in 1..10 {}
//~^ ERROR unnecessary parentheses around pattern
if(2 == 1) {}
//~^ ERROR unnecessary parentheses around `if` condition
// reported by parser
for(_x in 1..10) {}
//~^ ERROR unexpected parentheses surrounding
}