]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/single_match.rs
iterate List by value
[rust.git] / tests / ui / single_match.rs
index 99e88019cb89d3a28a21177eb250f5d5f4ba0752..1c55af5dfb673536605d3443bc135b4d49209e65 100644 (file)
@@ -23,7 +23,7 @@ fn single_match() {
 
     let z = (1u8, 1u8);
     match z {
-        (2...3, 7...9) => dummy(),
+        (2..=3, 7..=9) => dummy(),
         _ => {},
     };
 
@@ -35,7 +35,7 @@ fn single_match() {
 
     // Not linted (no block with statements in the single arm)
     match z {
-        (2...3, 7...9) => println!("{:?}", z),
+        (2..=3, 7..=9) => println!("{:?}", z),
         _ => println!("nope"),
     }
 }
@@ -81,4 +81,15 @@ fn single_match_know_enum() {
     }
 }
 
-fn main() {}
+macro_rules! single_match {
+    ($num:literal) => {
+        match $num {
+            15 => println!("15"),
+            _ => (),
+        }
+    };
+}
+
+fn main() {
+    single_match!(5);
+}