Skip to content

Commit 235a87f

Browse files
committed
Make next_items a SmallVec.
For consistency, and to make the code slightly nicer.
1 parent c13ca42 commit 235a87f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_expand/src/mbe/macro_parser.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ fn parse_tt_inner<'root, 'tt>(
491491
sess: &ParseSess,
492492
ms: &[TokenTree],
493493
cur_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
494-
next_items: &mut Vec<MatcherPosHandle<'root, 'tt>>,
494+
next_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
495495
bb_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
496496
token: &Token,
497497
) -> Option<NamedParseResult> {
@@ -708,10 +708,9 @@ pub(super) fn parse_tt(
708708
// there are frequently *no* others! -- are allocated on the heap.
709709
let mut initial = MatcherPos::new(ms);
710710
let mut cur_items = smallvec![MatcherPosHandle::Ref(&mut initial)];
711-
let mut next_items = Vec::new();
712711

713712
loop {
714-
assert!(next_items.is_empty());
713+
let mut next_items = SmallVec::new();
715714

716715
// Matcher positions black-box parsed by parser.rs (`parser`)
717716
let mut bb_items = SmallVec::new();

0 commit comments

Comments
 (0)