about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-06-14 23:01:32 +0200
committerJonas Schievink <jonasschievink@gmail.com>2020-06-14 23:46:15 +0200
commit26e17ae8892d0232e8f519e0c79cde44d5fd046b (patch)
treed65b617f57092ae4099722421cbb58467c3c0b8f /src
parent9014df55c65fdb3d89d6273cf0ecdfbec2444cdb (diff)
downloadrust-26e17ae8892d0232e8f519e0c79cde44d5fd046b.tar.gz
rust-26e17ae8892d0232e8f519e0c79cde44d5fd046b.zip
Remove `Adjustment::DerefMove`
It does the same thing as `Deref` now
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/shim.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/librustc_mir/shim.rs b/src/librustc_mir/shim.rs
index f95fd9b9e90..5ee1fc684f0 100644
--- a/src/librustc_mir/shim.rs
+++ b/src/librustc_mir/shim.rs
@@ -32,13 +32,9 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
 
     let mut result = match instance {
         ty::InstanceDef::Item(..) => bug!("item {:?} passed to make_shim", instance),
-        ty::InstanceDef::VtableShim(def_id) => build_call_shim(
-            tcx,
-            instance,
-            Some(Adjustment::DerefMove),
-            CallKind::Direct(def_id),
-            None,
-        ),
+        ty::InstanceDef::VtableShim(def_id) => {
+            build_call_shim(tcx, instance, Some(Adjustment::Deref), CallKind::Direct(def_id), None)
+        }
         ty::InstanceDef::FnPtrShim(def_id, ty) => {
             // FIXME(eddyb) support generating shims for a "shallow type",
             // e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic
@@ -136,7 +132,6 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
 enum Adjustment {
     Identity,
     Deref,
-    DerefMove,
     RefMut,
 }
 
@@ -701,8 +696,7 @@ fn build_call_shim<'tcx>(
 
     let rcvr = rcvr_adjustment.map(|rcvr_adjustment| match rcvr_adjustment {
         Adjustment::Identity => Operand::Move(rcvr_place()),
-        Adjustment::Deref => Operand::Move(tcx.mk_place_deref(rcvr_place())), // Can't copy `&mut`
-        Adjustment::DerefMove => Operand::Move(tcx.mk_place_deref(rcvr_place())),
+        Adjustment::Deref => Operand::Move(tcx.mk_place_deref(rcvr_place())),
         Adjustment::RefMut => {
             // let rcvr = &mut rcvr;
             let ref_rcvr = local_decls.push(