about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-05-15 10:58:39 +0200
committerGitHub <noreply@github.com>2023-05-15 10:58:39 +0200
commit7a1f3e7a8839b9872a5c0e5cbd895269ef3e00de (patch)
tree49dfb12fb4d96a42552a67c4c43fe27b0b8c861a /compiler/rustc_parse/src/parser
parent28bc8745ad752e80a05a8b075e701c314a7b1040 (diff)
parent83789b8b068ad38c6a3c937d0a2c6ca64e588c85 (diff)
downloadrust-7a1f3e7a8839b9872a5c0e5cbd895269ef3e00de.tar.gz
rust-7a1f3e7a8839b9872a5c0e5cbd895269ef3e00de.zip
Rollup merge of #111531 - chenyukang:yukang-fix-111416-ice, r=compiler-errors
Fix ice caused by shorthand fields in NoFieldsForFnCall

Fixes #111416
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 887e155426f..ee712a8e1b5 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -1180,6 +1180,10 @@ impl<'a> Parser<'a> {
                         self.restore_snapshot(snapshot);
                         let close_paren = self.prev_token.span;
                         let span = lo.to(close_paren);
+                        // filter shorthand fields
+                        let fields: Vec<_> =
+                            fields.into_iter().filter(|field| !field.is_shorthand).collect();
+
                         if !fields.is_empty() &&
                             // `token.kind` should not be compared here.
                             // This is because the `snapshot.token.kind` is treated as the same as