]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unit_cmp.rs
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / unit_cmp.rs
index e8726bf73644221d107f994d4f064f3ad5b1207d..8d3a4eed82e3e6a41bf220dad7e46f3d59a4f7f1 100644 (file)
@@ -1,16 +1,3 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-#![feature(tool_lints)]
-
-
 #![warn(clippy::unit_cmp)]
 #![allow(clippy::no_effect, clippy::unnecessary_operation)]
 
 
 fn main() {
     // this is fine
-    if true == false {
-    }
+    if true == false {}
 
     // this warns
-    if { true; } == { false; } {
-    }
-
-    if { true; } > { false; } {
-    }
+    if {
+        true;
+    } == {
+        false;
+    } {}
+
+    if {
+        true;
+    } > {
+        false;
+    } {}
+
+    assert_eq!(
+        {
+            true;
+        },
+        {
+            false;
+        }
+    );
+    debug_assert_eq!(
+        {
+            true;
+        },
+        {
+            false;
+        }
+    );
+
+    assert_ne!(
+        {
+            true;
+        },
+        {
+            false;
+        }
+    );
+    debug_assert_ne!(
+        {
+            true;
+        },
+        {
+            false;
+        }
+    );
 }