Skip to content

Commit 26e17ae

Browse files
Remove Adjustment::DerefMove
It does the same thing as `Deref` now
1 parent 9014df5 commit 26e17ae

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/librustc_mir/shim.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
3232

3333
let mut result = match instance {
3434
ty::InstanceDef::Item(..) => bug!("item {:?} passed to make_shim", instance),
35-
ty::InstanceDef::VtableShim(def_id) => build_call_shim(
36-
tcx,
37-
instance,
38-
Some(Adjustment::DerefMove),
39-
CallKind::Direct(def_id),
40-
None,
41-
),
35+
ty::InstanceDef::VtableShim(def_id) => {
36+
build_call_shim(tcx, instance, Some(Adjustment::Deref), CallKind::Direct(def_id), None)
37+
}
4238
ty::InstanceDef::FnPtrShim(def_id, ty) => {
4339
// FIXME(eddyb) support generating shims for a "shallow type",
4440
// 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<'
136132
enum Adjustment {
137133
Identity,
138134
Deref,
139-
DerefMove,
140135
RefMut,
141136
}
142137

@@ -701,8 +696,7 @@ fn build_call_shim<'tcx>(
701696

702697
let rcvr = rcvr_adjustment.map(|rcvr_adjustment| match rcvr_adjustment {
703698
Adjustment::Identity => Operand::Move(rcvr_place()),
704-
Adjustment::Deref => Operand::Move(tcx.mk_place_deref(rcvr_place())), // Can't copy `&mut`
705-
Adjustment::DerefMove => Operand::Move(tcx.mk_place_deref(rcvr_place())),
699+
Adjustment::Deref => Operand::Move(tcx.mk_place_deref(rcvr_place())),
706700
Adjustment::RefMut => {
707701
// let rcvr = &mut rcvr;
708702
let ref_rcvr = local_decls.push(

0 commit comments

Comments
 (0)