2022-06-25 12:16:30 +00:00
|
|
|
#![feature(lint_reasons)]
|
2021-09-14 16:48:30 +00:00
|
|
|
#![allow(unused, clippy::diverging_sub_expression)]
|
2020-01-13 22:41:11 +00:00
|
|
|
#![warn(clippy::logic_bug)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a: bool = unimplemented!();
|
|
|
|
let b: bool = unimplemented!();
|
|
|
|
let c: bool = unimplemented!();
|
|
|
|
let d: bool = unimplemented!();
|
|
|
|
let e: bool = unimplemented!();
|
|
|
|
let _ = a && b || a;
|
|
|
|
let _ = !(a && b);
|
|
|
|
let _ = false && a;
|
|
|
|
// don't lint on cfgs
|
|
|
|
let _ = cfg!(you_shall_not_not_pass) && a;
|
|
|
|
let _ = a || !b || !c || !d || !e;
|
|
|
|
let _ = !(a && b || c);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn equality_stuff() {
|
|
|
|
let a: i32 = unimplemented!();
|
|
|
|
let b: i32 = unimplemented!();
|
|
|
|
let _ = a == b && a != b;
|
|
|
|
let _ = a < b && a >= b;
|
|
|
|
let _ = a > b && a <= b;
|
|
|
|
let _ = a > b && a == b;
|
|
|
|
}
|
2022-06-25 12:16:30 +00:00
|
|
|
|
|
|
|
fn check_expect() {
|
|
|
|
let a: i32 = unimplemented!();
|
|
|
|
let b: i32 = unimplemented!();
|
|
|
|
#[expect(clippy::logic_bug)]
|
|
|
|
let _ = a < b && a >= b;
|
|
|
|
}
|