Skip to content

Commit ebd53e1

Browse files
committed
---
yaml --- r: 153118 b: refs/heads/try2 c: ff9995e h: refs/heads/master v: v3
1 parent 8561f53 commit ebd53e1

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 63fb7c6f4049ba33cb2fcd5d5d117a3e484bd181
8+
refs/heads/try2: ff9995e08978cec4b6987d198e09ac5ba6b6c152
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libsyntax/ext/expand.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,28 @@ mod test {
13871387
0)
13881388
}
13891389

1390+
// closure arg hygiene
1391+
// expands to fn f(){(|x_1 : int| {(x_2 + x_1)})(3);}
1392+
#[test] fn closure_arg_hygiene(){
1393+
run_renaming_test(
1394+
&("macro_rules! inject_x (()=>(x))
1395+
fn f(){(|x : int| {(inject_x!() + x)})(3);}",
1396+
vec!(vec!(1)),
1397+
true),
1398+
0)
1399+
}
1400+
1401+
// closure arg hygiene (ExprProc)
1402+
// expands to fn f(){(proc(x_1 : int) {(x_2 + x_1)})(3);}
1403+
#[test] fn closure_arg_hygiene_2(){
1404+
run_renaming_test(
1405+
&("macro_rules! inject_x (()=>(x))
1406+
fn f(){ (proc(x : int){(inject_x!() + x)})(3); }",
1407+
vec!(vec!(1)),
1408+
true),
1409+
0)
1410+
}
1411+
13901412
// run one of the renaming tests
13911413
fn run_renaming_test(t: &RenamingTest, test_idx: uint) {
13921414
let invalid_name = token::special_idents::invalid.name;

0 commit comments

Comments
 (0)