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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#![feature(plugin)]
#![plugin(clippy)]
#![warn(unit_expr)]
#[allow(unused_variables)]
fn main() {
// lint should note removing the semicolon from "baz"
let x = {
"foo";
"baz";
};
// lint should ignore false positive.
let y = if true {
"foo"
} else {
return;
};
// lint should note removing semicolon from "bar"
let z = if true {
"foo";
} else {
"bar";
};
let a1 = Some(5);
// lint should ignore false positive
let a2 = match a1 {
Some(x) => x,
_ => {
return;
},
};
// lint should note removing the semicolon after `x;`
let a3 = match a1 {
Some(x) => {
x;
},
_ => {
0;
},
};
}