]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/default_numeric_fallback_f64.rs
Move MSRV tests into the lint specific test files
[rust.git] / tests / ui / default_numeric_fallback_f64.rs
index 50bbb6eec6c700fdbdb7a54051e48c21715b0dbd..2476fe95141dece897a260b54d29ace5e612c9c5 100644 (file)
@@ -2,12 +2,15 @@
 // aux-build:macro_rules.rs
 
 #![warn(clippy::default_numeric_fallback)]
-#![allow(unused)]
-#![allow(clippy::never_loop)]
-#![allow(clippy::no_effect)]
-#![allow(clippy::unnecessary_operation)]
-#![allow(clippy::branches_sharing_code)]
-#![allow(clippy::match_single_binding)]
+#![allow(
+    unused,
+    clippy::never_loop,
+    clippy::no_effect,
+    clippy::unnecessary_operation,
+    clippy::branches_sharing_code,
+    clippy::match_single_binding,
+    clippy::let_unit_value
+)]
 
 #[macro_use]
 extern crate macro_rules;
@@ -30,6 +33,7 @@ fn test() {
         let x: [f64; 3] = [1., 2., 3.];
         let x: (f64, f64) = if true { (1., 2.) } else { (3., 4.) };
         let x: _ = 1.;
+        const X: f32 = 1.;
     }
 }
 
@@ -56,6 +60,14 @@ fn test() {
             // Should NOT lint this because this literal is bound to `_` of outer `Local`.
             2.
         };
+
+        const X: f32 = {
+            // Should lint this because this literal is not bound to any types.
+            let y = 1.;
+
+            // Should NOT lint this because this literal is bound to `_` of outer `Local`.
+            1.
+        };
     }
 }