diff options
| author | Adolfo OchagavĂa <aochagavia92@gmail.com> | 2014-12-12 17:34:28 +0100 |
|---|---|---|
| committer | Adolfo OchagavĂa <aochagavia92@gmail.com> | 2014-12-12 17:34:28 +0100 |
| commit | b99fb55f0fcbaabf96c1a56b0d905f41d4fe33a2 (patch) | |
| tree | 8e91856fe095a3d3964650d615df6f641baae909 /src/libsyntax | |
| parent | d2e2bd1b442948d4754bb1eb09ff1914a83604dd (diff) | |
| download | rust-b99fb55f0fcbaabf96c1a56b0d905f41d4fe33a2.tar.gz rust-b99fb55f0fcbaabf96c1a56b0d905f41d4fe33a2.zip | |
Fix #19734 (ICE)
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 a697d332d16..414241ee2bf 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1026,16 +1026,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 + } } }) } |
