aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/body
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-10 14:52:25 +0100
committerGitHub <[email protected]>2020-04-10 14:52:25 +0100
commit38e0d0f3348900bb4078deb09d48c5b6483d43d6 (patch)
tree6076dca34f94c198541850c8a3ce39c2e5173c89 /crates/ra_hir_def/src/body
parent0a891d19ae6740c13ddbf8dfaf8b4703d5ca821b (diff)
parente63315b8f189396cf556f21d4ca27ae4281d17d7 (diff)
Merge #3905
3905: add ellipsis field to hir pat record r=matklad a=JoshMcguigan This PR corrects a `fixme`, adding an `ellipsis` field to the hir `Pat::Record` type. It will also be unlock some useful follow on work for #3894. Additionally it adds a diagnostic for missing fields in record patterns. ~~Marking as a draft because I don't have any tests, and a small amount of manual testing on my branch from #3894 suggests it might *not* be working. Any thoughts on how I can best test this, or else pointers on where I might be going wrong?~~ Co-authored-by: Josh Mcguigan <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index b0d71eb3d..0855c1d3a 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -668,7 +668,9 @@ impl ExprCollector<'_> {
668 }); 668 });
669 fields.extend(iter); 669 fields.extend(iter);
670 670
671 Pat::Record { path, args: fields } 671 let ellipsis = record_field_pat_list.dotdot_token().is_some();
672
673 Pat::Record { path, args: fields, ellipsis }
672 } 674 }
673 ast::Pat::SlicePat(p) => { 675 ast::Pat::SlicePat(p) => {
674 let SlicePatComponents { prefix, slice, suffix } = p.components(); 676 let SlicePatComponents { prefix, slice, suffix } = p.components();