rust-clippy/tests/ui/modulo_one.rs
Andre Bogus 5823e9468d New is_integer_const to check more const ints
This mostly affects loop checks and the modulo_one lint. Tests
were also updated where applicable.
2019-09-10 17:46:39 +02:00

14 lines
226 B
Rust

#![warn(clippy::modulo_one)]
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
static STATIC_ONE: usize = 2 - 1;
fn main() {
10 % 1;
10 % 2;
const ONE: u32 = 1 * 1;
2 % ONE;
5 % STATIC_ONE;
}