@@ -229,6 +229,20 @@ pub fn expand_expr(e: Gc<ast::Expr>, fld: &mut MacroExpander) -> Gc<ast::Expr> {
229
229
fld. cx . expr ( e. span , ast:: ExprLoop ( loop_block, opt_ident) )
230
230
}
231
231
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
+
232
246
_ => noop_fold_expr ( e, fld)
233
247
}
234
248
}
@@ -1387,7 +1401,7 @@ mod test {
1387
1401
0 )
1388
1402
}
1389
1403
1390
- // closure arg hygiene
1404
+ // closure arg hygiene (ExprFnBlock)
1391
1405
// expands to fn f(){(|x_1 : int| {(x_2 + x_1)})(3);}
1392
1406
#[ test] fn closure_arg_hygiene ( ) {
1393
1407
run_renaming_test (
0 commit comments