Skip to content

Commit 9f0798b

Browse files
committed
Add a useful assertion.
1 parent 4d4baf7 commit 9f0798b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_expand/src/mbe/macro_parser.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,8 @@ fn inner_parse_loop<'root, 'tt>(
521521
// then we could be at the end of a sequence or at the beginning of the next
522522
// repetition.
523523
if let Some(repetition) = &item.repetition {
524+
debug_assert!(matches!(item.top_elts, Tt(TokenTree::Sequence(..))));
525+
524526
// At this point, regardless of whether there is a separator, we should add all
525527
// matches from the complete repetition of the sequence to the shared, top-level
526528
// `matches` list (actually, `up.matches`, which could itself not be the top-level,

0 commit comments

Comments
 (0)