rust-clippy/tests/ui/erasing_op.rs
Yury Krivopalov 033c99b1ba Add erasing_op lint
For expressions that can be replaced by a zero.
2017-10-14 12:34:37 +03:00

12 lines
110 B
Rust

#[allow(no_effect)]
#[warn(erasing_op)]
fn main() {
let x: u8 = 0;
x * 0;
0 & x;
0 / x;
}