about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-08-07 06:28:05 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-08-07 06:54:56 +0000
commitcdbfe9fce300b9a28e7f2106bcb85df38d72ae66 (patch)
tree0ce2e75802e7f2818659088ac1f009a38926d607 /src
parent8f73fc83dda9cfbd4e78b709961a8cf0cb0f8300 (diff)
downloadrust-cdbfe9fce300b9a28e7f2106bcb85df38d72ae66.tar.gz
rust-cdbfe9fce300b9a28e7f2106bcb85df38d72ae66.zip
Add test for metavariable hygiene.
Diffstat (limited to 'src')
-rw-r--r--src/test/compile-fail/macro-tt-matchers.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/compile-fail/macro-tt-matchers.rs b/src/test/compile-fail/macro-tt-matchers.rs
index f41da77ee98..945490cefb9 100644
--- a/src/test/compile-fail/macro-tt-matchers.rs
+++ b/src/test/compile-fail/macro-tt-matchers.rs
@@ -16,5 +16,16 @@ macro_rules! foo {
 
 foo!(Box);
 
+macro_rules! bar {
+    ($x:tt) => {
+        macro_rules! baz {
+            ($x:tt, $y:tt) => { ($x, $y) }
+        }
+    }
+}
+
 #[rustc_error]
-fn main() {} //~ ERROR compilation successful
+fn main() { //~ ERROR compilation successful
+    bar!($y);
+    let _: (i8, i16) = baz!(0i8, 0i16);
+}