about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/unnecessary_semicolon.fixed
blob: 36d5c7806fe84a17c62aef8d5c4031d5fc0a5302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#![warn(clippy::unnecessary_semicolon)]
#![feature(postfix_match)]

fn no_lint(mut x: u32) -> Option<u32> {
    Some(())?;

    {
        let y = 3;
        dbg!(x + y)
    };

    {
        let (mut a, mut b) = (10, 20);
        (a, b) = (b + 1, a + 1);
    }

    Some(0)
}

fn main() {
    let mut a = 3;
    if a == 2 {
        println!("This is weird");
    }
    //~^ ERROR: unnecessary semicolon

    a.match {
        3 => println!("three"),
        _ => println!("not three"),
    }
    //~^ ERROR: unnecessary semicolon
}