]> 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 b48435cc7b282a049e8c4425381898e7b31b2702..2476fe95141dece897a260b54d29ace5e612c9c5 100644 (file)
@@ -33,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.;
     }
 }
 
@@ -59,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.
+        };
     }
 }