diff options
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index f13a4329d3b..cd3b8db2303 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -1359,11 +1359,7 @@ impl<'a> Parser<'a> { (self.token == token::Lt && // `foo:<bar`, likely a typoed turbofish. self.look_ahead(1, |t| t.is_ident() && !t.is_reserved_ident())) || self.token.is_ident() && - match node { - // `foo::` → `foo:` or `foo.bar::` → `foo.bar:` - ast::ExprKind::Path(..) | ast::ExprKind::Field(..) => true, - _ => false, - } && + matches!(node, ast::ExprKind::Path(..) | ast::ExprKind::Field(..)) && !self.token.is_reserved_ident() && // v `foo:bar(baz)` self.look_ahead(1, |t| t == &token::OpenDelim(token::Paren)) || self.look_ahead(1, |t| t == &token::OpenDelim(token::Brace)) // `foo:bar {` |
