mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-03 09:59:33 +00:00
d708b444e4
Otherwise code like this #![no_implicit_prelude] fn main() { ::std::todo!(); ::std::unimplemented!(); } will fail to compile, which is unfortunate and presumably unintended. This changes many invocations of `panic!` in a `macro_rules!` definition to invocations of `$crate::panic!`, which makes the invocations hygienic. Note that this does not make the built-in macro `assert!` hygienic.
26 lines
731 B
Rust
26 lines
731 B
Rust
#![allow(unused, clippy::many_single_char_names, clippy::diverging_sub_expression)]
|
|
#![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;
|
|
}
|