File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
compiler/rustc_expand/src/mbe Expand file tree Collapse file tree 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>(
524524 // then we could be at the end of a sequence or at the beginning of the next
525525 // repetition.
526526 if let Some ( repetition) = & item. repetition {
527+ debug_assert ! ( idx <= len + 1 ) ;
527528 debug_assert ! ( matches!( item. top_elts, Tt ( TokenTree :: Sequence ( ..) ) ) ) ;
528529
529530 // At this point, regardless of whether there is a separator, we should add all
@@ -569,6 +570,7 @@ fn parse_tt_inner<'root, 'tt>(
569570 } else {
570571 // If we are not in a repetition, then being at the end of a matcher means that we
571572 // have reached the potential end of the input.
573+ debug_assert_eq ! ( idx, len) ;
572574 eof_items = match eof_items {
573575 EofItems :: None => EofItems :: One ( item) ,
574576 EofItems :: One ( _) | EofItems :: Multiple => EofItems :: Multiple ,
You can’t perform that action at this time.
0 commit comments