summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/issue-103435-extra-parentheses.fixed
blob: 2b01b414baa6ea8f57b33d0c2c858f11de50d838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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 expected one of
    //~| ERROR unexpected parentheses surrounding
}