Skip to content

Commit 7bad96e

Browse files
committed
improve match test case to include guard
1 parent 47eec97 commit 7bad96e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libsyntax/ext/expand.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,13 +1274,13 @@ mod test {
12741274
}
12751275

12761276
// FIXME #9384, match variable hygiene. Should expand into
1277-
// fn z() {match 8 {x_1 => {match 9 {x_2 | x_2 => x_2 + x_1}}}}
1277+
// fn z() {match 8 {x_1 => {match 9 {x_2 | x_2 if x_2 == x_1 => x_2 + x_1}}}}
12781278
#[test] fn issue_9384(){
12791279
run_renaming_test(
1280-
&("macro_rules! bad_macro (($ex:expr) => ({match 9 {x | x => x + $ex}}))
1281-
fn z() {match 8 {x => bad_macro!(_x)}}",
1280+
&("macro_rules! bad_macro (($ex:expr) => ({match 9 {x | x if x == $ex => x + $ex}}))
1281+
fn z() {match 8 {x => bad_macro!(x)}}",
12821282
// NB: the third "binding" is the repeat of the second one.
1283-
vec!(vec!(1),vec!(0),vec!(0)),
1283+
vec!(vec!(1,3),vec!(0,2),vec!(0,2)),
12841284
true),
12851285
0)
12861286
}

0 commit comments

Comments
 (0)