2016-03-25 04:42:27 -05:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
#![deny(invalid_upcast_comparisons)]
|
2016-05-13 09:43:47 -05:00
|
|
|
#![allow(unused, eq_op, no_effect, unnecessary_operation)]
|
2016-03-25 04:42:27 -05:00
|
|
|
fn main() {
|
|
|
|
let zero: u32 = 0;
|
|
|
|
let u8_max: u8 = 255;
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
(u8_max as u32) > 300;
|
2016-03-25 04:42:27 -05:00
|
|
|
(u8_max as u32) > 20;
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
(zero as i32) < -5;
|
2016-03-25 04:42:27 -05:00
|
|
|
(zero as i32) < 10;
|
2016-03-25 17:47:27 -05:00
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
-5 < (zero as i32);
|
|
|
|
0 <= (zero as i32);
|
2016-03-25 17:47:27 -05:00
|
|
|
0 < (zero as i32);
|
2016-03-28 23:44:18 -05:00
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
-5 > (zero as i32);
|
|
|
|
-5 >= (u8_max as i32);
|
|
|
|
1337 == (u8_max as i32);
|
2016-03-29 00:08:58 -05:00
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
-5 == (zero as i32);
|
|
|
|
-5 != (u8_max as i32);
|
2016-04-02 08:51:28 -05:00
|
|
|
|
|
|
|
// Those are Ok:
|
|
|
|
42 == (u8_max as i32);
|
|
|
|
42 != (u8_max as i32);
|
|
|
|
42 > (u8_max as i32);
|
|
|
|
(u8_max as i32) == 42;
|
|
|
|
(u8_max as i32) != 42;
|
|
|
|
(u8_max as i32) > 42;
|
|
|
|
(u8_max as i32) < 42;
|
2016-03-25 04:42:27 -05:00
|
|
|
}
|