3 #[allow(clippy::identity_op, clippy::double_parens, clippy::many_single_char_names)]
4 #[allow(clippy::no_effect, unused_variables, clippy::unnecessary_operation, clippy::short_circuit_statement)]
5 #[warn(clippy::nonminimal_bool)]
7 // simple values and comparisons
10 // even though I agree that no means no ;-)
15 // casts, methods, parentheses
16 (1 as u64) & (1 as u64);
19 // unary and binary operators
21 ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
22 (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
24 // various other things
27 vec![1, 2, 3] == vec![1, 2, 3]; //no error yet, as we don't match macros
50 2*a.len() == 2*a.len(); // ok, functions
51 a.pop() == a.pop(); // ok, functions
57 fn bitand(self, rhs: X) -> X {
61 impl<'a> BitAnd<&'a X> for X {
63 fn bitand(self, rhs: &'a X) -> X {
71 #[derive(Copy, Clone)]
75 fn bitand(self, rhs: Y) -> Y {
79 impl<'a> BitAnd<&'a Y> for Y {
81 fn bitand(self, rhs: &'a Y) -> Y {
94 const C: u32 = A / B; // ok, different named constants
99 macro_rules! check_if_named_foo {
100 ($expression:expr) => (
101 if stringify!($expression) == "foo" {
104 println!("not foo.");
109 fn check_ignore_macro() {
110 check_if_named_foo!(foo);