1 #![feature(tool_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 #[warn(clippy::nonminimal_bool)]
9 // simple values and comparisons
12 // even though I agree that no means no ;-)
17 // casts, methods, parentheses
18 (1 as u64) & (1 as u64);
21 // unary and binary operators
23 ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
24 (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
26 // various other things
29 vec![1, 2, 3] == vec![1, 2, 3]; //no error yet, as we don't match macros
52 2*a.len() == 2*a.len(); // ok, functions
53 a.pop() == a.pop(); // ok, functions
59 fn bitand(self, rhs: X) -> X {
63 impl<'a> BitAnd<&'a X> for X {
65 fn bitand(self, rhs: &'a X) -> X {
73 #[derive(Copy, Clone)]
77 fn bitand(self, rhs: Y) -> Y {
81 impl<'a> BitAnd<&'a Y> for Y {
83 fn bitand(self, rhs: &'a Y) -> Y {
96 const C: u32 = A / B; // ok, different named constants
100 macro_rules! check_if_named_foo {
101 ($expression:expr) => (
102 if stringify!($expression) == "foo" {
105 println!("not foo.");
110 fn check_ignore_macro() {
111 check_if_named_foo!(foo);