Skip to content

Commit

Permalink
Add test for metavariable hygiene.
Browse files Browse the repository at this point in the history
  • Loading branch information
jseyfried committed Aug 7, 2016
1 parent 8f73fc8 commit cdbfe9f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/test/compile-fail/macro-tt-matchers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit cdbfe9f

Please sign in to comment.