Skip to content

Commit 2a8a998

Browse files
committed
---
yaml --- r: 122841 b: refs/heads/master c: cc13f9b h: refs/heads/master i: 122839: 1142ab8 v: v3
1 parent 30389d9 commit 2a8a998

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ff9995e08978cec4b6987d198e09ac5ba6b6c152
2+
refs/heads/master: cc13f9bae8b4175513375f9de66f198a706c67d3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: aaff4e05e19b48d81e4ecb3337f288f42d06edd0
55
refs/heads/try: 2e9d9477b848cec778ca3f07ecdf0aea6ade23de

trunk/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)