Add a useful assertion.
This commit is contained in:
parent
600ec28483
commit
df6ead557d
1 changed files with 7 additions and 2 deletions
|
@ -588,8 +588,13 @@ impl<'tt> TtParser<'tt> {
|
|||
if *token == token::Eof {
|
||||
Some(match eof_items {
|
||||
EofItems::One(mut eof_item) => {
|
||||
let matches =
|
||||
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
|
||||
// multiple matches, which get aggregated into a `MatcherSeq` before being
|
||||
// put into the top-level.)
|
||||
debug_assert_eq!(dv.len(), 1);
|
||||
Lrc::make_mut(dv).pop().unwrap()
|
||||
});
|
||||
nameize(sess, ms, matches)
|
||||
}
|
||||
EofItems::Multiple => {
|
||||
|
|
Loading…
Add table
Reference in a new issue