We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 600ec28 commit df6ead5Copy full SHA for df6ead5
compiler/rustc_expand/src/mbe/macro_parser.rs
@@ -588,8 +588,13 @@ impl<'tt> TtParser<'tt> {
588
if *token == token::Eof {
589
Some(match eof_items {
590
EofItems::One(mut eof_item) => {
591
- let matches =
592
- eof_item.matches.iter_mut().map(|dv| Lrc::make_mut(dv).pop().unwrap());
+ let matches = eof_item.matches.iter_mut().map(|dv| {
+ // Top-level metavars only ever get one match. (Sub-matchers can get
593
+ // multiple matches, which get aggregated into a `MatcherSeq` before being
594
+ // put into the top-level.)
595
+ debug_assert_eq!(dv.len(), 1);
596
+ Lrc::make_mut(dv).pop().unwrap()
597
+ });
598
nameize(sess, ms, matches)
599
}
600
EofItems::Multiple => {
0 commit comments