]> git.lizzy.rs Git - rust.git/commitdiff
Closures are not generated code.
authorNick Cameron <ncameron@mozilla.com>
Mon, 31 Aug 2015 05:06:30 +0000 (17:06 +1200)
committerNick Cameron <ncameron@mozilla.com>
Mon, 31 Aug 2015 05:06:30 +0000 (17:06 +1200)
src/libsyntax/codemap.rs
src/libsyntax/ext/expand.rs

index e07cd7b5847e89ad6f812a92287012c1b18b0cf2..56a15ce895cf24f7fddc0cfd75f6e4e273b3095e 100644 (file)
@@ -275,7 +275,6 @@ pub enum CompilerExpansionFormat {
     PlacementIn,
     WhileLet,
     ForLoop,
-    Closure,
 }
 
 impl CompilerExpansionFormat {
@@ -285,7 +284,6 @@ pub fn name(self) -> &'static str {
             CompilerExpansionFormat::PlacementIn => "placement-in expansion",
             CompilerExpansionFormat::WhileLet => "while let expansion",
             CompilerExpansionFormat::ForLoop => "for loop expansion",
-            CompilerExpansionFormat::Closure => "closure expansion",
         }
     }
 }
index 3459caecb260a21c5c9aa06e7e806f28f989e116..c1c6918aba7be4ecc983f4da0e4348ce177f4b13 100644 (file)
@@ -459,15 +459,12 @@ fn allow_unstable(fld: &mut MacroExpander, span: Span) -> Span {
         }
 
         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)})
         }
 
         _ => {