diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2025-01-07 17:57:53 +0200 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2025-01-07 17:57:53 +0200 |
| commit | e103ab16084dc735b8db6b90186cd7b6967402ee (patch) | |
| tree | f2f3317a4a2031c7cc1a141c5703166e6fa1d107 /compiler/rustc_parse/src/parser | |
| parent | aa1ef0a432100170d07b89f487e18fc2673c40ba (diff) | |
| parent | fb546ee09b226bc4dd4b712d35a372d923c4fa54 (diff) | |
| download | rust-e103ab16084dc735b8db6b90186cd7b6967402ee.tar.gz rust-e103ab16084dc735b8db6b90186cd7b6967402ee.zip | |
Merge from rust-lang/rust
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 4 |
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 |
