diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/builder/matches/mod.rs | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index ff493fa65a6..d74a917f33c 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1516,8 +1516,8 @@ impl<'tcx> UserTypeProjections { self.contents.iter().map(|&(ref user_type, _span)| user_type) } - pub fn push_projection(mut self, user_ty: &UserTypeProjection, span: Span) -> Self { - self.contents.push((user_ty.clone(), span)); + pub fn push_user_type(mut self, base_user_ty: UserTypeAnnotationIndex, span: Span) -> Self { + self.contents.push((UserTypeProjection { base: base_user_ty, projs: vec![] }, span)); self } diff --git a/compiler/rustc_mir_build/src/builder/matches/mod.rs b/compiler/rustc_mir_build/src/builder/matches/mod.rs index ed577f7adeb..f551f0ceeda 100644 --- a/compiler/rustc_mir_build/src/builder/matches/mod.rs +++ b/compiler/rustc_mir_build/src/builder/matches/mod.rs @@ -926,12 +926,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // Note that the variance doesn't apply here, as we are tracking the effect // of `user_ty` on any bindings contained with subpattern. - let projection = UserTypeProjection { - base: self.canonical_user_type_annotations.push(annotation.clone()), - projs: Vec::new(), - }; + let base_user_ty = self.canonical_user_type_annotations.push(annotation.clone()); let subpattern_user_ty = - pattern_user_ty.push_projection(&projection, annotation.span); + pattern_user_ty.push_user_type(base_user_ty, annotation.span); self.visit_primary_bindings(subpattern, subpattern_user_ty, f) } |
