1 // does not test any rustfixable lints
5 #[allow(clippy::identity_op, clippy::double_parens, clippy::many_single_char_names)]
6 #[allow(clippy::no_effect, unused_variables, clippy::unnecessary_operation, clippy::short_circuit_statement)]
7 #[allow(clippy::nonminimal_bool)]
10 // simple values and comparisons
13 // even though I agree that no means no ;-)
18 // casts, methods, parentheses
19 (1 as u64) & (1 as u64);
22 // unary and binary operators
24 ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
25 (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
27 // various other things
30 vec![1, 2, 3] == vec![1, 2, 3]; //no error yet, as we don't match macros
53 2*a.len() == 2*a.len(); // ok, functions
54 a.pop() == a.pop(); // ok, functions
61 const C: u32 = A / B; // ok, different named constants
66 macro_rules! check_if_named_foo {
67 ($expression:expr) => (
68 if stringify!($expression) == "foo" {
76 macro_rules! bool_macro {
77 ($expression:expr) => {
82 #[allow(clippy::short_circuit_statement)]
83 fn check_ignore_macro() {
84 check_if_named_foo!(foo);
85 // checks if the lint ignores macros with `!` operator
86 !bool_macro!(1) && !bool_macro!("");