Remove TokenStream::flattened and InvisibleOrigin::FlattenToken.

They are no longer needed.

This does slightly worsen the error message for a single test, but that
test contains code that is so badly broken that I'm not worried about
it.
This commit is contained in:
Nicholas Nethercote 2024-07-04 10:16:51 +10:00
parent 4d8f7577b5
commit 4c0cbaeb9e
8 changed files with 12 additions and 70 deletions

View file

@ -237,12 +237,6 @@ impl<'a> StripUnconfigured<'a> {
inner = self.configure_tokens(&inner);
Some(AttrTokenTree::Delimited(sp, spacing, delim, inner))
}
AttrTokenTree::Token(
Token { kind: TokenKind::NtIdent(..) | TokenKind::NtLifetime(..), .. },
_,
) => {
panic!("Nonterminal should have been flattened: {:?}", tree);
}
AttrTokenTree::Token(
Token { kind: TokenKind::OpenDelim(_) | TokenKind::CloseDelim(_), .. },
_,