fix: fix regression in #109203

This commit is contained in:
Ezra Shaw 2023-04-07 08:54:13 +12:00
parent f5b8f44e5d
commit 9dbf20ef27
No known key found for this signature in database
GPG key ID: 67ABF16FB0ECD870
3 changed files with 24 additions and 2 deletions

View file

@ -423,11 +423,11 @@ impl<'a> Parser<'a> {
if let token::Literal(Lit {
kind: token::LitKind::Integer | token::LitKind::Float,
symbol,
suffix,
suffix: Some(suffix), // no suffix makes it a valid literal
}) = self.token.kind
&& rustc_ast::MetaItemLit::from_token(&self.token).is_none()
{
Some((symbol.as_str().len(), suffix.unwrap()))
Some((symbol.as_str().len(), suffix))
} else {
None
}