diff options
| -rw-r--r-- | src/test/run-pass/type-macros.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/run-pass/type-macros.rs b/src/test/run-pass/type-macros.rs index 3ca3be8efed..a5eb37b8cc3 100644 --- a/src/test/run-pass/type-macros.rs +++ b/src/test/run-pass/type-macros.rs @@ -57,9 +57,11 @@ impl<Rec: HList + Sized, X, Xs: HList, Ys: HList> Add<Ys> for Cons<X, Xs> where // type macro Expr allows us to expand the + operator appropriately macro_rules! Expr { { ( $($LHS:tt)+ ) } => { Expr!($($LHS)+) }; - { HList ! [ $($LHS:tt)* ] + $($RHS:tt)+ } => { <Expr!(HList![$($LHS)*]) as Add<Expr!($($RHS)+)>>::Output }; - { $LHS:tt + $($RHS:tt)+ } => { <Expr!($LHS) as Add<Expr!($($RHS)+)>>::Output }; - { $LHS:ty } => { $LHS }; + { HList ! [ $($LHS:tt)* ] + $($RHS:tt)+ } => { + <Expr!(HList![$($LHS)*]) as Add<Expr!($($RHS)+)>>::Output + }; + { $LHS:tt + $($RHS:tt)+ } => { <Expr!($LHS) as Add<Expr!($($RHS)+)>>::Output }; + { $LHS:ty } => { $LHS }; } // test demonstrating term level `xs + ys` and type level `Expr!(Xs + Ys)` |
