2017-09-03 08:56:34 -07:00
|
|
|
#![feature(plugin)]
|
2017-09-03 10:39:28 -07:00
|
|
|
#![plugin(clippy)]
|
|
|
|
|
#![warn(unit_expr)]
|
2017-09-03 08:56:34 -07:00
|
|
|
#[allow(unused_variables)]
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2017-09-03 13:39:49 -07:00
|
|
|
|
|
|
|
|
//lint should note removing the semicolon from "baz"
|
2017-09-03 08:56:34 -07:00
|
|
|
let x = {
|
|
|
|
|
"foo";
|
|
|
|
|
"baz";
|
|
|
|
|
};
|
2017-09-03 13:39:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
//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;},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2017-09-03 08:56:34 -07:00
|
|
|
}
|