Skip to content

Commit b99fb55

Browse files
committed
Fix #19734 (ICE)
1 parent d2e2bd1 commit b99fb55

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/libsyntax/ext/expand.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,16 +1026,17 @@ fn expand_method(m: P<ast::Method>, fld: &mut MacroExpander) -> SmallVector<P<as
10261026
|meths, mark| meths.move_map(|m| mark_method(m, mark)),
10271027
fld);
10281028

1029-
let new_methods = match maybe_new_methods {
1030-
Some(methods) => methods,
1029+
match maybe_new_methods {
1030+
Some(methods) => {
1031+
// expand again if necessary
1032+
let new_methods = methods.into_iter()
1033+
.flat_map(|m| fld.fold_method(m).into_iter())
1034+
.collect();
1035+
fld.cx.bt_pop();
1036+
new_methods
1037+
}
10311038
None => SmallVector::zero()
1032-
};
1033-
1034-
// expand again if necessary
1035-
let new_methods = new_methods.into_iter()
1036-
.flat_map(|m| fld.fold_method(m).into_iter()).collect();
1037-
fld.cx.bt_pop();
1038-
new_methods
1039+
}
10391040
}
10401041
})
10411042
}

0 commit comments

Comments
 (0)