rust-clippy/tests/ui/short_circuit_statement.rs

28 lines
208 B
Rust
Raw Normal View History

#![feature(plugin)]
#![plugin(clippy)]
#![deny(short_circuit_statement)]
fn main() {
f() && g();
2017-02-08 13:58:07 +00:00
f() || g();
2017-02-08 13:58:07 +00:00
1 == 2 || g();
2017-02-08 13:58:07 +00:00
}
fn f() -> bool {
true
}
fn g() -> bool {
false
}