]> git.lizzy.rs Git - rust.git/blob - tests/ui/int_plus_one.rs
Adapt ui-tests to the tool_lints
[rust.git] / tests / ui / int_plus_one.rs
1 #![feature(tool_lints)]
2
3
4 #[allow(clippy::no_effect, clippy::unnecessary_operation)]
5 #[warn(clippy::int_plus_one)]
6 fn main() {
7     let x = 1i32;
8     let y = 0i32;
9     
10     x >= y + 1;
11     y + 1 <= x;
12
13     x - 1 >= y;
14     y <= x - 1;
15
16     x > y; // should be ok
17     y < x; // should be ok
18 }