Auto merge of #28116 - nrc:closure-expand, r=alexcrichton

This commit is contained in:
bors 2015-08-31 13:10:23 +00:00
commit ce40c48c45
2 changed files with 1 additions and 6 deletions

View File

@ -275,7 +275,6 @@ pub enum CompilerExpansionFormat {
PlacementIn,
WhileLet,
ForLoop,
Closure,
}
impl CompilerExpansionFormat {
@ -285,7 +284,6 @@ impl CompilerExpansionFormat {
CompilerExpansionFormat::PlacementIn => "placement-in expansion",
CompilerExpansionFormat::WhileLet => "while let expansion",
CompilerExpansionFormat::ForLoop => "for loop expansion",
CompilerExpansionFormat::Closure => "closure expansion",
}
}
}

View File

@ -459,15 +459,12 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> {
}
ast::ExprClosure(capture_clause, fn_decl, block) => {
push_compiler_expansion(fld, span, CompilerExpansionFormat::Closure);
let (rewritten_fn_decl, rewritten_block)
= expand_and_rename_fn_decl_and_block(fn_decl, block, fld);
let new_node = ast::ExprClosure(capture_clause,
rewritten_fn_decl,
rewritten_block);
let result = P(ast::Expr{id:id, node: new_node, span: fld.new_span(span)});
fld.cx.bt_pop();
result
P(ast::Expr{id:id, node: new_node, span: fld.new_span(span)})
}
_ => {