diff options
| author | bors <bors@rust-lang.org> | 2023-05-15 11:56:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-15 11:56:07 +0000 |
| commit | 2913ad6db0f72fed5139253faed73200c7af3535 (patch) | |
| tree | aae689eb3707efe3394f54f76a2490f224fed1f5 /compiler/rustc_parse | |
| parent | 8006510ab0f69ee75e9c3f7e8bff3776886dae51 (diff) | |
| parent | 75186c0f7d3df657eff76c623dbec82d23e60f47 (diff) | |
| download | rust-2913ad6db0f72fed5139253faed73200c7af3535.tar.gz rust-2913ad6db0f72fed5139253faed73200c7af3535.zip | |
Auto merge of #111585 - matthiaskrgr:rollup-468pykj, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #102673 (Update doc for `PhantomData` to match code example) - #111531 (Fix ice caused by shorthand fields in NoFieldsForFnCall) - #111547 (Start node has no immediate dominator) - #111548 (add util function to TokenStream to eliminate some clones) - #111560 (Simplify find_width_of_character_at_span.) - #111569 (Appease lints) - #111581 (Fix some misleading and copy-pasted `Pattern` examples) - #111582 ((docs) Change "wanting" to "want") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 4 |
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 |
