]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_build/src/build/expr/as_place.rs
Auto merge of #100968 - cjgillot:mir-upvar-vec, r=wesleywiser
[rust.git] / compiler / rustc_mir_build / src / build / expr / as_place.rs
index 3ff7bf9622cfc924a2436394bd7133c61d33c173..ebb56e5a23365d636996c1b053825e9a463b3a6b 100644 (file)
@@ -455,7 +455,7 @@ fn expr_as_place(
                 block.and(place_builder)
             }
 
-            ExprKind::PlaceTypeAscription { source, user_ty } => {
+            ExprKind::PlaceTypeAscription { source, ref user_ty } => {
                 let place_builder = unpack!(
                     block = this.expr_as_place(
                         block,
@@ -468,7 +468,7 @@ fn expr_as_place(
                     let annotation_index =
                         this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
                             span: source_info.span,
-                            user_ty,
+                            user_ty: user_ty.clone(),
                             inferred_ty: expr.ty,
                         });
 
@@ -489,7 +489,7 @@ fn expr_as_place(
                 }
                 block.and(place_builder)
             }
-            ExprKind::ValueTypeAscription { source, user_ty } => {
+            ExprKind::ValueTypeAscription { source, ref user_ty } => {
                 let source = &this.thir[source];
                 let temp =
                     unpack!(block = this.as_temp(block, source.temp_lifetime, source, mutability));
@@ -497,7 +497,7 @@ fn expr_as_place(
                     let annotation_index =
                         this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
                             span: source_info.span,
-                            user_ty,
+                            user_ty: user_ty.clone(),
                             inferred_ty: expr.ty,
                         });
                     this.cfg.push(