]> git.lizzy.rs Git - rust.git/commitdiff
Add test for #2558
authorcodeworm96 <codeworm96@outlook.com>
Wed, 28 Mar 2018 15:50:21 +0000 (23:50 +0800)
committercodeworm96 <codeworm96@outlook.com>
Wed, 28 Mar 2018 15:50:21 +0000 (23:50 +0800)
When run against invalid macro definitions, rustfmt should leave
them unchanged rather than panic.

tests/source/macro_rules.rs
tests/target/macro_rules.rs

index 3f7f5d621c32843810bf2919081013d9b042fe00..51c80ad5b7dd115a3ad972185e489705f1715880 100644 (file)
@@ -188,3 +188,9 @@ macro_rules! binary {
         }
     };
 }
+
+// #2558
+macro_rules! m {
+    ($x:) => {};
+    ($($foo:expr)()?) => {};
+}
index 7d527b0c3fdac475b38378174001d597e0bbc511..451e78cb3a861a76413286dad73b228f02e6f59b 100644 (file)
@@ -220,3 +220,9 @@ macro_rules! binary {
         }
     };
 }
+
+// #2558
+macro_rules! m {
+    ($x:) => {};
+    ($($foo:expr)()?) => {};
+}