]> git.lizzy.rs Git - rust.git/blob - tests/ui/unseparated_prefix_literals.fixed
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / unseparated_prefix_literals.fixed
1 // run-rustfix
2
3 #![warn(clippy::unseparated_literal_suffix)]
4 #![allow(dead_code)]
5
6 #[macro_use]
7 extern crate clippy_mini_macro_test;
8
9 // Test for proc-macro attribute
10 #[derive(ClippyMiniMacroTest)]
11 struct Foo;
12
13 macro_rules! lit_from_macro {
14     () => {
15         42_usize
16     };
17 }
18
19 fn main() {
20     let _ok1 = 1234_i32;
21     let _ok2 = 1234_isize;
22     let _ok3 = 0x123_isize;
23     let _fail1 = 1234_i32;
24     let _fail2 = 1234_u32;
25     let _fail3 = 1234_isize;
26     let _fail4 = 1234_usize;
27     let _fail5 = 0x123_isize;
28
29     let _okf1 = 1.5_f32;
30     let _okf2 = 1_f32;
31     let _failf1 = 1.5_f32;
32     let _failf2 = 1_f32;
33
34     // Test for macro
35     let _ = lit_from_macro!();
36
37     // Counter example
38     let _ = line!();
39     // Because `assert!` contains `line!()` macro.
40     assert_eq!(4897_u32, 32223);
41 }