diff options
| author | bors <bors@rust-lang.org> | 2014-12-15 11:17:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-12-15 11:17:44 +0000 |
| commit | ef0bc464af110d24d4663fbe51eca3646a897308 (patch) | |
| tree | 10cb69c2683434aa4d36ad43a6d52f681a6e9383 /src/libsyntax | |
| parent | b677746b1e4412cc49efb9a59aaaa25f3e8fd87e (diff) | |
| parent | 8788cb05c23c1d14ad22e5046bf3d3d621cf401e (diff) | |
| download | rust-ef0bc464af110d24d4663fbe51eca3646a897308.tar.gz rust-ef0bc464af110d24d4663fbe51eca3646a897308.zip | |
auto merge of #19778 : aochagavia/rust/ice, r=alexcrichton
Fixes #19734
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 1a004ca7c44..e280e6e4491 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1021,16 +1021,17 @@ fn expand_method(m: P<ast::Method>, fld: &mut MacroExpander) -> SmallVector<P<as |meths, mark| meths.move_map(|m| mark_method(m, mark)), fld); - let new_methods = match maybe_new_methods { - Some(methods) => methods, + match maybe_new_methods { + Some(methods) => { + // expand again if necessary + let new_methods = methods.into_iter() + .flat_map(|m| fld.fold_method(m).into_iter()) + .collect(); + fld.cx.bt_pop(); + new_methods + } None => SmallVector::zero() - }; - - // expand again if necessary - let new_methods = new_methods.into_iter() - .flat_map(|m| fld.fold_method(m).into_iter()).collect(); - fld.cx.bt_pop(); - new_methods + } } }) } |
