]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unnecessary_cast_fixable.fixed
Addition `manual_map` test for `unsafe` blocks
[rust.git] / tests / ui / unnecessary_cast_fixable.fixed
index ba52fc2703f22cfb951512ac22f974c996987fb3..bda0f2c47cdd525a97a62f5e080334dc20e627c8 100644 (file)
@@ -1,13 +1,18 @@
 // run-rustfix
 
 #![warn(clippy::unnecessary_cast)]
-#![allow(clippy::no_effect, clippy::unnecessary_operation)]
+#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::nonstandard_macro_braces)]
 
 fn main() {
     // casting integer literal to float is unnecessary
     100_f32;
     100_f64;
     100_f64;
+    let _ = -100_f32;
+    let _ = -100_f64;
+    let _ = -100_f64;
+    100_f32;
+    100_f64;
     // Should not trigger
     #[rustfmt::skip]
     let v = vec!(1);
@@ -20,11 +25,16 @@ fn main() {
     0b11 as f64;
 
     1_u32;
-    16_i32;
-    2_usize;
+    0x10_i32;
+    0b10_usize;
+    0o73_u16;
+    1_000_000_000_u32;
 
     1.0_f64;
     0.5_f32;
 
     1.0 as u16;
+
+    let _ = -1_i32;
+    let _ = -1.0_f32;
 }