about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/default_numeric_fallback.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/default_numeric_fallback.rs')
-rw-r--r--src/tools/clippy/tests/ui/default_numeric_fallback.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/default_numeric_fallback.rs b/src/tools/clippy/tests/ui/default_numeric_fallback.rs
index 43468872db0..c0625fd1b75 100644
--- a/src/tools/clippy/tests/ui/default_numeric_fallback.rs
+++ b/src/tools/clippy/tests/ui/default_numeric_fallback.rs
@@ -1,3 +1,5 @@
+// aux-build:macro_rules.rs
+
 #![warn(clippy::default_numeric_fallback)]
 #![allow(unused)]
 #![allow(clippy::never_loop)]
@@ -5,6 +7,9 @@
 #![allow(clippy::unnecessary_operation)]
 #![allow(clippy::branches_sharing_code)]
 
+#[macro_use]
+extern crate macro_rules;
+
 mod basic_expr {
     fn test() {
         // Should lint unsuffixed literals typed `i32`.
@@ -133,4 +138,22 @@ mod method_calls {
     }
 }
 
+mod in_macro {
+    macro_rules! internal_macro {
+        () => {
+            let x = 22;
+        };
+    }
+
+    // Should lint in internal macro.
+    fn internal() {
+        internal_macro!();
+    }
+
+    // Should NOT lint in external macro.
+    fn external() {
+        default_numeric_fallback!();
+    }
+}
+
 fn main() {}