File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
branches/dist-snap/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 @@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: 63fb7c6f4049ba33cb2fcd5d5d117a3e484bd181
9
+ refs/heads/dist-snap: ff9995e08978cec4b6987d198e09ac5ba6b6c152
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
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