Skip to content

Commit 90d3454

Browse files
committed
---
yaml --- r: 153119 b: refs/heads/try2 c: cc13f9b h: refs/heads/master i: 153117: 8561f53 153115: 70f9701 153111: 5afaa5f 153103: 950580c 153087: dd4e80a v: v3
1 parent ebd53e1 commit 90d3454

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
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: ff9995e08978cec4b6987d198e09ac5ba6b6c152
8+
refs/heads/try2: cc13f9bae8b4175513375f9de66f198a706c67d3
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: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,20 @@ pub fn expand_expr(e: Gc<ast::Expr>, fld: &mut MacroExpander) -> Gc<ast::Expr> {
229229
fld.cx.expr(e.span, ast::ExprLoop(loop_block, opt_ident))
230230
}
231231

232+
ast::ExprFnBlock(fn_decl, block) => {
233+
let (rewritten_fn_decl, rewritten_block)
234+
= expand_and_rename_fn_decl_and_block(fn_decl, block, fld);
235+
let new_node = ast::ExprFnBlock(rewritten_fn_decl, rewritten_block);
236+
box(GC) ast::Expr{id:e.id, node: new_node, span: fld.new_span(e.span)}
237+
}
238+
239+
ast::ExprProc(fn_decl, block) => {
240+
let (rewritten_fn_decl, rewritten_block)
241+
= expand_and_rename_fn_decl_and_block(fn_decl, block, fld);
242+
let new_node = ast::ExprProc(rewritten_fn_decl, rewritten_block);
243+
box(GC) ast::Expr{id:e.id, node: new_node, span: fld.new_span(e.span)}
244+
}
245+
232246
_ => noop_fold_expr(e, fld)
233247
}
234248
}
@@ -1387,7 +1401,7 @@ mod test {
13871401
0)
13881402
}
13891403

1390-
// closure arg hygiene
1404+
// closure arg hygiene (ExprFnBlock)
13911405
// expands to fn f(){(|x_1 : int| {(x_2 + x_1)})(3);}
13921406
#[test] fn closure_arg_hygiene(){
13931407
run_renaming_test(

0 commit comments

Comments
 (0)