]> git.lizzy.rs Git - rust.git/commitdiff
Update tests
authorSeiichi Uchida <seuchida@gmail.com>
Sat, 17 Mar 2018 16:08:02 +0000 (01:08 +0900)
committertopecongiro <seuchida@gmail.com>
Sun, 18 Mar 2018 23:23:53 +0000 (08:23 +0900)
tests/source/macro_rules.rs
tests/target/macro_rules.rs

index ea3cefa873865278e235eb3a9ea7b32a4f075729..17bb30678692e37a59f5171af64698b23450c29b 100644 (file)
@@ -1,5 +1,14 @@
 // rustfmt-error_on_line_overflow: false
 
+macro_rules! m {
+    () => ();
+    ( $ x : ident ) => ();
+    ( $ m1 : ident , $ m2 : ident , $ x : ident ) => ();
+    ( $($beginning:ident),*;$middle:ident;$($end:ident),* ) => ();
+    ( $($beginning: ident),*; $middle: ident; $($end: ident),*; $($beginning: ident),*; $middle: ident; $($end: ident),* ) => {};
+    ( $ name : ident ( $ ( $ dol : tt $ var : ident ) * ) $ ( $ body : tt ) * ) => ();
+}
+
 macro_rules! m {
        // a
        ($expr :expr,  $( $func : ident    ) *   ) => {
@@ -88,12 +97,7 @@ fn foo() {
 
 // #2439
 macro_rules! m {
-    (
-        $line0_xxxxxxxxxxxxxxxxx: expr,
-        $line1_xxxxxxxxxxxxxxxxx: expr,
-        $line2_xxxxxxxxxxxxxxxxx: expr,
-        $line3_xxxxxxxxxxxxxxxxx: expr,
-    ) => {};
+    ($line0_xxxxxxxxxxxxxxxxx: expr, $line1_xxxxxxxxxxxxxxxxx: expr, $line2_xxxxxxxxxxxxxxxxx: expr, $line3_xxxxxxxxxxxxxxxxx: expr,) => {};
 }
 
 // #2466
index bc9c6aa40223febd7588d6a49279acb6aa60a5e7..5bedc2a8258894eb17484c93701ac253d9067577 100644 (file)
@@ -1,5 +1,21 @@
 // rustfmt-error_on_line_overflow: false
 
+macro_rules! m {
+    () => {};
+    ($x: ident) => {};
+    ($m1: ident, $m2: ident, $x: ident) => {};
+    ($($beginning: ident),*; $middle: ident; $($end: ident),*) => {};
+    (
+        $($beginning: ident),*;
+        $middle: ident;
+        $($end: ident),*;
+        $($beginning: ident),*;
+        $middle: ident;
+        $($end: ident),*
+    ) => {};
+    ($name: ident($($dol: tt $var: ident)*) $($body: tt)*) => {};
+}
+
 macro_rules! m {
     // a
     ($expr: expr, $($func: ident)*) => {{