diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-07 06:28:05 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-07 06:54:56 +0000 |
| commit | cdbfe9fce300b9a28e7f2106bcb85df38d72ae66 (patch) | |
| tree | 0ce2e75802e7f2818659088ac1f009a38926d607 /src | |
| parent | 8f73fc83dda9cfbd4e78b709961a8cf0cb0f8300 (diff) | |
| download | rust-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.rs | 13 |
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); +} |
