diff options
| author | David Tolnay <dtolnay@gmail.com> | 2024-12-27 14:25:08 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2024-12-27 14:33:56 -0800 |
| commit | 26bb4e64645d3f3e0ed0b2921738e56888f96fd1 (patch) | |
| tree | 54f6022830fff10d7f50565245b6d531bbbcd2b7 /compiler/rustc_parse/src/parser/diagnostics.rs | |
| parent | c95f9f50de555454cbd931c026814e46793a820a (diff) | |
| download | rust-26bb4e64645d3f3e0ed0b2921738e56888f96fd1.tar.gz rust-26bb4e64645d3f3e0ed0b2921738e56888f96fd1.zip | |
Skip parenthesis around tuple struct field calls
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index aab4e1b1afc..7df7e732925 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -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 |
