From 77627ea8dd3b310d02138647363e72fdd024bb6c Mon Sep 17 00:00:00 2001 From: Christopher Chambers Date: Sat, 11 Apr 2015 00:59:00 -0500 Subject: [PATCH] Moves expand_stmt's bt_pop so that it balances correctly. --- src/libsyntax/ext/expand.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 8e6b5f85440b..8aa6acaeec2c 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -761,13 +761,14 @@ fn expand_stmt(stmt: P, fld: &mut MacroExpander) -> SmallVector> { let mut fully_expanded = match maybe_new_items { Some(stmts) => { // Keep going, outside-in. - stmts.into_iter().flat_map(|s| { + let new_items = stmts.into_iter().flat_map(|s| { fld.fold_stmt(s).into_iter() - }).collect() + }).collect(); + fld.cx.bt_pop(); + new_items } None => SmallVector::zero() }; - fld.cx.bt_pop(); // If this is a macro invocation with a semicolon, then apply that // semicolon to the final statement produced by expansion.