rust/tests/compile-fail/if_not_else.rs
2016-02-29 12:34:48 +01:00

19 lines
371 B
Rust

#![feature(plugin)]
#![plugin(clippy)]
#![deny(clippy)]
fn bla() -> bool { unimplemented!() }
fn main() {
if !bla() { //~ ERROR: Unnecessary boolean `not` operation
println!("Bugs");
} else {
println!("Bunny");
}
if 4 != 5 { //~ ERROR: Unnecessary `!=` operation
println!("Bugs");
} else {
println!("Bunny");
}
}