]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_transform/src/deref_separator.rs
simplify more, ret_deref -> has_deref
[rust.git] / compiler / rustc_mir_transform / src / deref_separator.rs
index bfb3ad1be2734039046f574b6003bb454fda9d33..a00bb16f7ac67c79c32c93c785beab9fb3b9a40c 100644 (file)
@@ -35,6 +35,7 @@ fn visit_place(&mut self, place: &mut Place<'tcx>, cntxt: PlaceContext, loc: Loc
                     last_deref_idx = idx;
                 }
             }
+
             for (idx, (p_ref, p_elem)) in place.iter_projections().enumerate() {
                 if !p_ref.projection.is_empty() && p_elem == ProjectionElem::Deref {
                     let ty = p_ref.ty(&self.local_decls, self.tcx).ty;
@@ -54,7 +55,7 @@ fn visit_place(&mut self, place: &mut Place<'tcx>, cntxt: PlaceContext, loc: Loc
                     self.patcher.add_assign(
                         loc,
                         Place::from(temp),
-                        Rvalue::Use(Operand::Move(deref_place)),
+                        Rvalue::CopyForDeref(deref_place),
                     );
                     place_local = temp;
                     last_len = p_ref.projection.len();