]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unseparated_prefix_literals.rs
iterate List by value
[rust.git] / tests / ui / unseparated_prefix_literals.rs
index d70b1cf29f53f06195fd1f72c210efd1f5f691fb..09608661e0ef58585afbb94a1d2fdc1fa2c36fee 100644 (file)
@@ -3,6 +3,19 @@
 #![warn(clippy::unseparated_literal_suffix)]
 #![allow(dead_code)]
 
+#[macro_use]
+extern crate clippy_mini_macro_test;
+
+// Test for proc-macro attribute
+#[derive(ClippyMiniMacroTest)]
+struct Foo;
+
+macro_rules! lit_from_macro {
+    () => {
+        42usize
+    };
+}
+
 fn main() {
     let _ok1 = 1234_i32;
     let _ok2 = 1234_isize;
@@ -17,4 +30,12 @@ fn main() {
     let _okf2 = 1_f32;
     let _failf1 = 1.5f32;
     let _failf2 = 1f32;
+
+    // Test for macro
+    let _ = lit_from_macro!();
+
+    // Counter example
+    let _ = line!();
+    // Because `assert!` contains `line!()` macro.
+    assert_eq!(4897u32, 32223);
 }