diff options
Diffstat (limited to 'compiler/rustc_mir_build/src/build/matches/util.rs')
-rw-r--r-- | compiler/rustc_mir_build/src/build/matches/util.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_mir_build/src/build/matches/util.rs b/compiler/rustc_mir_build/src/build/matches/util.rs index 9a1e98d3b..b61c4fe50 100644 --- a/compiler/rustc_mir_build/src/build/matches/util.rs +++ b/compiler/rustc_mir_build/src/build/matches/util.rs @@ -26,19 +26,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { &mut self, match_pairs: &mut SmallVec<[MatchPair<'pat, 'tcx>; 1]>, place: &PlaceBuilder<'tcx>, - prefix: &'pat [Pat<'tcx>], - opt_slice: Option<&'pat Pat<'tcx>>, - suffix: &'pat [Pat<'tcx>], + prefix: &'pat [Box<Pat<'tcx>>], + opt_slice: &'pat Option<Box<Pat<'tcx>>>, + suffix: &'pat [Box<Pat<'tcx>>], ) { let tcx = self.tcx; let (min_length, exact_size) = if let Ok(place_resolved) = - place.clone().try_upvars_resolved(tcx, self.typeck_results) + place.clone().try_upvars_resolved(tcx, &self.upvars) { - match place_resolved - .into_place(tcx, self.typeck_results) - .ty(&self.local_decls, tcx) - .ty - .kind() + match place_resolved.into_place(tcx, &self.upvars).ty(&self.local_decls, tcx).ty.kind() { ty::Array(_, length) => (length.eval_usize(tcx, self.param_env), true), _ => ((prefix.len() + suffix.len()).try_into().unwrap(), false), |