Skip to content

Commit

Permalink
Moves expand_stmt's bt_pop so that it balances correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-chambers committed Apr 11, 2015
1 parent 22eb319 commit 77627ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libsyntax/ext/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,13 +761,14 @@ fn expand_stmt(stmt: P<Stmt>, fld: &mut MacroExpander) -> SmallVector<P<Stmt>> {
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.
Expand Down

0 comments on commit 77627ea

Please sign in to comment.