about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@users.noreply.github.com>2025-01-07 16:13:25 +0000
committerGitHub <noreply@github.com>2025-01-07 16:13:25 +0000
commitfd1e95538fa3b3ca87fc4f7df5e9abd918949536 (patch)
treef2f3317a4a2031c7cc1a141c5703166e6fa1d107 /compiler/rustc_parse/src/parser
parent8e4409cce3e4a7f7eb974462c943e717db818ed8 (diff)
parente103ab16084dc735b8db6b90186cd7b6967402ee (diff)
downloadrust-fd1e95538fa3b3ca87fc4f7df5e9abd918949536.tar.gz
rust-fd1e95538fa3b3ca87fc4f7df5e9abd918949536.zip
Merge pull request #18874 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index aab4e1b1afc..9ee6c2fae1a 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -755,7 +755,7 @@ impl<'a> Parser<'a> {
         // When there are a few keywords in the last ten elements of `self.expected_token_types`
         // and the current token is an identifier, it's probably a misspelled keyword. This handles
         // code like `async Move {}`, misspelled `if` in match guard, misspelled `else` in
-        // `if`-`else` and mispelled `where` in a where clause.
+        // `if`-`else` and misspelled `where` in a where clause.
         if !expected_keywords.is_empty()
             && !curr_ident.is_used_keyword()
             && let Some(misspelled_kw) = find_similar_kw(curr_ident, &expected_keywords)
@@ -1336,7 +1336,7 @@ impl<'a> Parser<'a> {
     ) -> bool {
         if let ExprKind::Binary(op, l1, r1) = &inner_op.kind {
             if let ExprKind::Field(_, ident) = l1.kind
-                && ident.as_str().parse::<i32>().is_err()
+                && !ident.is_numeric()
                 && !matches!(r1.kind, ExprKind::Lit(_))
             {
                 // The parser has encountered `foo.bar<baz`, the likelihood of the turbofish