File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
branches/try2/src/libsyntax/ext Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 63fb7c6f4049ba33cb2fcd5d5d117a3e484bd181
8
+ refs/heads/try2: ff9995e08978cec4b6987d198e09ac5ba6b6c152
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -1387,6 +1387,28 @@ mod test {
1387
1387
0 )
1388
1388
}
1389
1389
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
+
1390
1412
// run one of the renaming tests
1391
1413
fn run_renaming_test ( t : & RenamingTest , test_idx : uint ) {
1392
1414
let invalid_name = token:: special_idents:: invalid. name ;
You can’t perform that action at this time.
0 commit comments