diff options
author | Dawer <[email protected]> | 2021-05-02 16:56:54 +0100 |
---|---|---|
committer | Dawer <[email protected]> | 2021-05-31 20:03:46 +0100 |
commit | 3ffcb2658cc2199271d3a22f9747517d8e2892d6 (patch) | |
tree | 170f3136628491d82114afd7f14090d85c92ec6a /crates/hir_ty/src | |
parent | 3a85e47f6ab586328ee17bb27e8dae3e3e247e23 (diff) |
Complete field replacing
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs b/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs index 393d99997..d3513c406 100644 --- a/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs +++ b/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs | |||
@@ -811,8 +811,13 @@ impl Fields { | |||
811 | pats: impl IntoIterator<Item = Pat>, | 811 | pats: impl IntoIterator<Item = Pat>, |
812 | ) -> Self { | 812 | ) -> Self { |
813 | let pats = { | 813 | let pats = { |
814 | let mut arena = cx.pattern_arena.borrow_mut(); | 814 | let tys: SmallVec<[Ty; 2]> = match self { |
815 | pats.into_iter().map(move |pat| /* arena.alloc(pat) */ todo!()).collect() | 815 | Fields::Vec(pats) => pats.iter().copied().map(|pat| cx.type_of(pat)).collect(), |
816 | }; | ||
817 | pats.into_iter() | ||
818 | .zip(tys.into_iter()) | ||
819 | .map(move |(pat, ty)| cx.alloc_pat(pat, &ty)) | ||
820 | .collect() | ||
816 | }; | 821 | }; |
817 | 822 | ||
818 | match self { | 823 | match self { |