rust/tests/ui/modulo_one.rs

15 lines
226 B
Rust
Raw Normal View History

2018-07-28 15:34:52 +00:00
#![warn(clippy::modulo_one)]
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
static STATIC_ONE: usize = 2 - 1;
fn main() {
2017-02-08 13:58:07 +00:00
10 % 1;
10 % 2;
const ONE: u32 = 1 * 1;
2 % ONE;
5 % STATIC_ONE;
}