Skip parenthesis around tuple struct field calls

This commit is contained in:
David Tolnay 2024-12-27 14:25:08 -08:00
parent c95f9f50de
commit 26bb4e6464
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
4 changed files with 11 additions and 3 deletions

View file

@ -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