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 {
|
if *token == token::Eof {
|
||||||
Some(match eof_items {
|
Some(match eof_items {
|
||||||
EofItems::One(mut eof_item) => {
|
EofItems::One(mut eof_item) => {
|
||||||
let matches =
|
let matches = eof_item.matches.iter_mut().map(|dv| {
|
||||||
eof_item.matches.iter_mut().map(|dv| Lrc::make_mut(dv).pop().unwrap());
|
// 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)
|
nameize(sess, ms, matches)
|
||||||
}
|
}
|
||||||
EofItems::Multiple => {
|
EofItems::Multiple => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue