]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/eq_op.rs
Auto merge of #8374 - Alexendoo:bless-revisions, r=camsteffen
[rust.git] / tests / ui / eq_op.rs
index e9a685b9c79a962d1597f4984b9bc0ca207a1690..707b449f82e4f04ea4e85b4efeb76b17820aaa33 100644 (file)
@@ -2,10 +2,11 @@
 
 #[rustfmt::skip]
 #[warn(clippy::eq_op)]
-#[allow(clippy::identity_op, clippy::double_parens, clippy::many_single_char_names)]
+#[allow(clippy::identity_op, clippy::double_parens)]
 #[allow(clippy::no_effect, unused_variables, clippy::unnecessary_operation, clippy::short_circuit_statement)]
 #[allow(clippy::nonminimal_bool)]
 #[allow(unused)]
+#[allow(clippy::unnecessary_cast)]
 fn main() {
     // simple values and comparisons
     1 == 1;
@@ -73,6 +74,24 @@ macro_rules! check_if_named_foo {
     )
 }
 
+macro_rules! bool_macro {
+    ($expression:expr) => {
+        true
+    };
+}
+
+#[allow(clippy::short_circuit_statement)]
 fn check_ignore_macro() {
     check_if_named_foo!(foo);
+    // checks if the lint ignores macros with `!` operator
+    !bool_macro!(1) && !bool_macro!("");
+}
+
+struct Nested {
+    inner: ((i32,), (i32,), (i32,)),
+}
+
+fn check_nested(n1: &Nested, n2: &Nested) -> bool {
+    // `n2.inner.0.0` mistyped as `n1.inner.0.0`
+    (n1.inner.0).0 == (n1.inner.0).0 && (n1.inner.1).0 == (n2.inner.1).0 && (n1.inner.2).0 == (n2.inner.2).0
 }