rust/tests/ui-toml/modulo_arithmetic/modulo_arithmetic.rs
2025-02-15 13:38:43 +01:00

14 lines
286 B
Rust

#![warn(clippy::modulo_arithmetic)]
fn main() {
let a = -1;
let b = 2;
let c = a % b == 0;
//~^ modulo_arithmetic
let c = a % b != 0;
//~^ modulo_arithmetic
let c = 0 == a % b;
//~^ modulo_arithmetic
let c = 0 != a % b;
//~^ modulo_arithmetic
}