Skip to content

Commit ef48530

Browse files
committed
Closures are not generated code.
1 parent 8f28c9b commit ef48530

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/libsyntax/codemap.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ pub enum CompilerExpansionFormat {
275275
PlacementIn,
276276
WhileLet,
277277
ForLoop,
278-
Closure,
279278
}
280279

281280
impl CompilerExpansionFormat {
@@ -285,7 +284,6 @@ impl CompilerExpansionFormat {
285284
CompilerExpansionFormat::PlacementIn => "placement-in expansion",
286285
CompilerExpansionFormat::WhileLet => "while let expansion",
287286
CompilerExpansionFormat::ForLoop => "for loop expansion",
288-
CompilerExpansionFormat::Closure => "closure expansion",
289287
}
290288
}
291289
}

src/libsyntax/ext/expand.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,15 +459,12 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> {
459459
}
460460

461461
ast::ExprClosure(capture_clause, fn_decl, block) => {
462-
push_compiler_expansion(fld, span, CompilerExpansionFormat::Closure);
463462
let (rewritten_fn_decl, rewritten_block)
464463
= expand_and_rename_fn_decl_and_block(fn_decl, block, fld);
465464
let new_node = ast::ExprClosure(capture_clause,
466465
rewritten_fn_decl,
467466
rewritten_block);
468-
let result = P(ast::Expr{id:id, node: new_node, span: fld.new_span(span)});
469-
fld.cx.bt_pop();
470-
result
467+
P(ast::Expr{id:id, node: new_node, span: fld.new_span(span)})
471468
}
472469

473470
_ => {

0 commit comments

Comments
 (0)