Skip to content

Commit

Permalink
Add a useful assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Mar 11, 2022
1 parent 4d4baf7 commit 9f0798b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_expand/src/mbe/macro_parser.rs
Expand Up @@ -521,6 +521,8 @@ fn inner_parse_loop<'root, 'tt>(
// then we could be at the end of a sequence or at the beginning of the next
// repetition.
if let Some(repetition) = &item.repetition {
debug_assert!(matches!(item.top_elts, Tt(TokenTree::Sequence(..))));

// At this point, regardless of whether there is a separator, we should add all
// matches from the complete repetition of the sequence to the shared, top-level
// `matches` list (actually, `up.matches`, which could itself not be the top-level,
Expand Down

0 comments on commit 9f0798b

Please sign in to comment.