1
Fork 0

Fix fallout in tests.

This commit is contained in:
Jeffrey Seyfried 2016-09-27 06:38:17 +00:00
parent 9de6bdc3cf
commit 057302bcd9
2 changed files with 8 additions and 8 deletions

View file

@ -17,7 +17,7 @@ macro_rules! foo { () => {
let _ = bar!(); let _ = bar!();
}} }}
macro_rules! bar { // test issue #31856 macro_rules! m { // test issue #31856
($n:ident) => ( ($n:ident) => (
let a = 1; let a = 1;
let $n = a; let $n = a;

View file

@ -22,23 +22,23 @@ fn f() {
fn g() { fn g() {
let x = 0; let x = 0;
macro_rules! m { ($x:ident) => { macro_rules! m { ($m1:ident, $m2:ident, $x:ident) => {
macro_rules! m2 { () => { ($x, x) } } macro_rules! $m1 { () => { ($x, x) } }
let x = 1; let x = 1;
macro_rules! m3 { () => { ($x, x) } } macro_rules! $m2 { () => { ($x, x) } }
} } } }
let x = 2; let x = 2;
m!(x); m!(m2, m3, x);
let x = 3; let x = 3;
assert_eq!(m2!(), (2, 0)); assert_eq!(m2!(), (2, 0));
assert_eq!(m3!(), (2, 1)); assert_eq!(m3!(), (2, 1));
let x = 4; let x = 4;
m!(x); m!(m4, m5, x);
assert_eq!(m2!(), (4, 0)); assert_eq!(m4!(), (4, 0));
assert_eq!(m3!(), (4, 1)); assert_eq!(m5!(), (4, 1));
} }
mod foo { mod foo {