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!();
}}
macro_rules! bar { // test issue #31856
macro_rules! m { // test issue #31856
($n:ident) => (
let a = 1;
let $n = a;

View File

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