]> git.lizzy.rs Git - rust.git/blob - tests/ui/int_plus_one.rs
Merge branch 'master' into add-lints-aseert-checks
[rust.git] / tests / ui / int_plus_one.rs
1 #[allow(clippy::no_effect, clippy::unnecessary_operation)]
2 #[warn(clippy::int_plus_one)]
3 fn main() {
4     let x = 1i32;
5     let y = 0i32;
6
7     x >= y + 1;
8     y + 1 <= x;
9
10     x - 1 >= y;
11     y <= x - 1;
12
13     x > y; // should be ok
14     y < x; // should be ok
15 }