]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/bool_comparison.rs
iterate List by value
[rust.git] / tests / ui / bool_comparison.rs
index 36d31aa043bb9ec700bcd6e0f216fa1816521f33..01ee35859f0da64c055a3eb6a9b313b77e597cb7 100644 (file)
@@ -1,3 +1,5 @@
+// run-rustfix
+
 #[warn(clippy::bool_comparison)]
 fn main() {
     let x = true;
@@ -109,3 +111,19 @@ fn partial_cmp(&self, _: &Foo) -> Option<std::cmp::Ordering> {
     if Foo < false {}
     if false < Foo {}
 }
+
+#[allow(dead_code)]
+fn issue4983() {
+    let a = true;
+    let b = false;
+
+    if a == !b {};
+    if !a == b {};
+    if a == b {};
+    if !a == !b {};
+
+    if b == !a {};
+    if !b == a {};
+    if b == a {};
+    if !b == !a {};
+}