diff options
Diffstat (limited to 'crates/hir_ty/src/diagnostics/pattern')
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs b/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs index 91b9c7184..1c86ed59b 100644 --- a/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs +++ b/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs | |||
@@ -801,12 +801,7 @@ impl Fields { | |||
801 | cx: &MatchCheckCtx<'_>, | 801 | cx: &MatchCheckCtx<'_>, |
802 | pats: impl IntoIterator<Item = Pat>, | 802 | pats: impl IntoIterator<Item = Pat>, |
803 | ) -> Self { | 803 | ) -> Self { |
804 | let pats = { | 804 | let pats = pats.into_iter().map(|pat| cx.alloc_pat(pat)).collect(); |
805 | let tys: SmallVec<[Ty; 2]> = match self { | ||
806 | Fields::Vec(pats) => pats.iter().copied().map(|pat| cx.type_of(pat)).collect(), | ||
807 | }; | ||
808 | pats.into_iter().zip(tys.into_iter()).map(move |(pat, ty)| cx.alloc_pat(pat)).collect() | ||
809 | }; | ||
810 | 805 | ||
811 | match self { | 806 | match self { |
812 | Fields::Vec(_) => Fields::Vec(pats), | 807 | Fields::Vec(_) => Fields::Vec(pats), |