diff options
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 18b661034e0..7820bbc1789 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -359,7 +359,7 @@ impl<'a> Parser<'a> { /// report error for `let 1x = 123` pub fn report_invalid_identifier_error(&mut self) -> PResult<'a, ()> { if let token::Literal(lit) = self.token.uninterpolate().kind && - let Err(_) = rustc_ast::Lit::from_token(&self.token) && + rustc_ast::Lit::from_token(&self.token).is_none() && (lit.kind == token::LitKind::Integer || lit.kind == token::LitKind::Float) && self.look_ahead(1, |t| matches!(t.kind, token::Eq) || matches!(t.kind, token::Colon ) ) { return Err(self.sess.create_err(InvalidIdentiferStartsWithNumber { span: self.token.span })); |
