]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/mistyped_literal_suffix.fixed
Auto merge of #97944 - nikic:freebsd-update, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / mistyped_literal_suffix.fixed
index 5d57638af43495bea12bce75b930aa600ae51343..a7b36d53cd26c7cc1011553d0a1ceb2fd88268ae 100644 (file)
@@ -5,7 +5,8 @@
     unused_variables,
     overflowing_literals,
     clippy::excessive_precision,
-    clippy::inconsistent_digit_grouping
+    clippy::inconsistent_digit_grouping,
+    clippy::unusual_byte_groupings
 )]
 
 fn main() {
@@ -25,5 +26,18 @@ fn main() {
     let fail28 = 241_251_235E723_f64;
     let ok29 = 42279.911_32;
 
+    // testing that the suggestion actually fits in its type
+    let fail30 = 127_i8; // should be i8
+    let fail31 = 240_u8; // should be u8
+    let ok32 = 360_8; // doesnt fit in either, should be ignored
+    let fail33 = 0x1234_i16;
+    let fail34 = 0xABCD_u16;
+    let ok35 = 0x12345_16;
+    let fail36 = 0xFFFF_FFFF_FFFF_FFFF_u64; // u64
+
+    // issue #6129
+    let ok37 = 123_32.123;
+    let ok38 = 124_64.0;
+
     let _ = 1.123_45E1_f32;
 }