]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/match_single_binding.rs
iterate List by value
[rust.git] / tests / ui / match_single_binding.rs
index 4a4b290036c79b23872c2f51321591770f569ba5..8c182148ae184652c18b413e3f239dde954b6da1 100644 (file)
@@ -12,6 +12,14 @@ fn coords() -> Point {
     Point { x: 1, y: 2 }
 }
 
+macro_rules! foo {
+    ($param:expr) => {
+        match $param {
+            _ => println!("whatever"),
+        }
+    };
+}
+
 fn main() {
     let a = 1;
     let b = 2;
@@ -27,6 +35,8 @@ fn main() {
         (x, y, z) => println!("{} {} {}", x, y, z),
     }
     // Ok
+    foo!(a);
+    // Ok
     match a {
         2 => println!("2"),
         _ => println!("Not 2"),