2016-03-23 14:50:47 +01:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
2016-03-24 10:45:24 +01:00
|
|
|
#![deny(nonminimal_bool, logic_bug)]
|
2016-03-23 14:50:47 +01:00
|
|
|
|
2016-03-24 15:37:17 +01:00
|
|
|
#[allow(unused, many_single_char_names)]
|
2016-03-23 14:50:47 +01:00
|
|
|
fn main() {
|
|
|
|
let a: bool = unimplemented!();
|
|
|
|
let b: bool = unimplemented!();
|
2016-03-24 10:54:48 +01:00
|
|
|
let c: bool = unimplemented!();
|
2016-03-24 15:37:17 +01:00
|
|
|
let d: bool = unimplemented!();
|
|
|
|
let e: bool = unimplemented!();
|
2017-02-08 14:58:07 +01:00
|
|
|
let _ = a && b || a;
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-24 10:54:48 +01:00
|
|
|
let _ = !(a && b);
|
2017-02-08 14:58:07 +01:00
|
|
|
let _ = !true;
|
|
|
|
|
|
|
|
|
|
|
|
let _ = !false;
|
|
|
|
|
|
|
|
|
|
|
|
let _ = !!a;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let _ = false && a;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let _ = false || a;
|
|
|
|
|
|
|
|
|
2016-03-24 09:37:16 +01:00
|
|
|
|
|
|
|
// don't lint on cfgs
|
|
|
|
let _ = cfg!(you_shall_not_not_pass) && a;
|
2016-03-24 10:54:48 +01:00
|
|
|
|
2016-03-24 15:37:17 +01:00
|
|
|
let _ = a || !b || !c || !d || !e;
|
|
|
|
|
2016-03-24 10:54:48 +01:00
|
|
|
let _ = !(a && b || c);
|
2016-03-24 15:37:17 +01:00
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
let _ = !(!a && b);
|
|
|
|
|
|
|
|
|
2016-03-23 14:50:47 +01:00
|
|
|
}
|
2016-03-24 15:44:08 +01:00
|
|
|
|
|
|
|
#[allow(unused, many_single_char_names)]
|
|
|
|
fn equality_stuff() {
|
|
|
|
let a: i32 = unimplemented!();
|
|
|
|
let b: i32 = unimplemented!();
|
|
|
|
let c: i32 = unimplemented!();
|
|
|
|
let d: i32 = unimplemented!();
|
|
|
|
let e: i32 = unimplemented!();
|
2016-06-07 18:32:26 +02:00
|
|
|
let _ = a == b && a != b;
|
2017-02-08 14:58:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-07 18:32:26 +02:00
|
|
|
let _ = a == b && c == 5 && a == b;
|
2017-02-08 14:58:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-07 18:32:26 +02:00
|
|
|
let _ = a == b && c == 5 && b == a;
|
2017-02-08 14:58:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-07 18:32:26 +02:00
|
|
|
let _ = a < b && a >= b;
|
2017-02-08 14:58:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-07 18:32:26 +02:00
|
|
|
let _ = a > b && a <= b;
|
2017-02-08 14:58:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-24 15:44:08 +01:00
|
|
|
let _ = a > b && a == b;
|
2016-03-29 10:44:35 +02:00
|
|
|
|
2016-06-07 18:32:26 +02:00
|
|
|
let _ = a != b || !(a != b || c == d);
|
2017-02-08 14:58:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-24 15:44:08 +01:00
|
|
|
}
|