Avoid a useless clone of UserTypeProjection
This commit is contained in:
parent
bf3bb5fd37
commit
a64efc72d0
2 changed files with 4 additions and 7 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue