File tree 1 file changed +2
-0
lines changed
compiler/rustc_expand/src/mbe
1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -524,6 +524,7 @@ fn parse_tt_inner<'root, 'tt>(
524
524
// then we could be at the end of a sequence or at the beginning of the next
525
525
// repetition.
526
526
if let Some ( repetition) = & item. repetition {
527
+ debug_assert ! ( idx <= len + 1 ) ;
527
528
debug_assert ! ( matches!( item. top_elts, Tt ( TokenTree :: Sequence ( ..) ) ) ) ;
528
529
529
530
// At this point, regardless of whether there is a separator, we should add all
@@ -569,6 +570,7 @@ fn parse_tt_inner<'root, 'tt>(
569
570
} else {
570
571
// If we are not in a repetition, then being at the end of a matcher means that we
571
572
// have reached the potential end of the input.
573
+ debug_assert_eq ! ( idx, len) ;
572
574
eof_items = match eof_items {
573
575
EofItems :: None => EofItems :: One ( item) ,
574
576
EofItems :: One ( _) | EofItems :: Multiple => EofItems :: Multiple ,
You can’t perform that action at this time.
0 commit comments