Skip to content

Commit b888e89

Browse files
committed
remove a machine hook that is no longer used
1 parent 2005c2e commit b888e89

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

compiler/rustc_const_eval/src/interpret/eval_context.rs

-3
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ impl<'tcx, Prov: Provenance> LocalState<'tcx, Prov> {
221221

222222
/// Overwrite the local. If the local can be overwritten in place, return a reference
223223
/// to do so; otherwise return the `MemPlace` to consult instead.
224-
///
225-
/// Note: Before calling this, call the `before_access_local_mut` machine hook! You may be
226-
/// invalidating machine invariants otherwise!
227224
#[inline(always)]
228225
pub(super) fn access_mut(&mut self) -> InterpResult<'tcx, &mut Operand<Prov>> {
229226
match &mut self.value {

compiler/rustc_const_eval/src/interpret/machine.rs

-18
Original file line numberDiff line numberDiff line change
@@ -260,24 +260,6 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
260260
F2::NAN
261261
}
262262

263-
/// Called before writing the specified `local` of the `frame`.
264-
/// Since writing a ZST is not actually accessing memory or locals, this is never invoked
265-
/// for ZST reads.
266-
///
267-
/// Due to borrow checker trouble, we indicate the `frame` as an index rather than an `&mut
268-
/// Frame`.
269-
#[inline(always)]
270-
fn before_access_local_mut<'a>(
271-
_ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
272-
_frame: usize,
273-
_local: mir::Local,
274-
) -> InterpResult<'tcx>
275-
where
276-
'tcx: 'mir,
277-
{
278-
Ok(())
279-
}
280-
281263
/// Called before a basic block terminator is executed.
282264
#[inline]
283265
fn before_terminator(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {

compiler/rustc_const_eval/src/interpret/place.rs

-3
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ where
624624
dest.force_mplace(self)?
625625
} else {
626626
debug_assert_eq!(locals_addr, self.frame().locals_addr());
627-
M::before_access_local_mut(self, self.frame_idx(), local)?;
628627
match self.frame_mut().locals[local].access_mut()? {
629628
Operand::Immediate(local_val) => {
630629
// Local can be updated in-place.
@@ -740,7 +739,6 @@ where
740739
dest.force_mplace(self)?
741740
} else {
742741
debug_assert_eq!(locals_addr, self.frame().locals_addr());
743-
M::before_access_local_mut(self, self.frame_idx(), local)?;
744742
match self.frame_mut().locals[local].access_mut()? {
745743
Operand::Immediate(local) => {
746744
*local = Immediate::Uninit;
@@ -921,7 +919,6 @@ where
921919
let mplace = match place.place {
922920
Place::Local { local, offset, locals_addr } => {
923921
debug_assert_eq!(locals_addr, self.frame().locals_addr());
924-
M::before_access_local_mut(self, self.frame_idx(), local)?;
925922
let whole_local = match self.frame_mut().locals[local].access_mut()? {
926923
&mut Operand::Immediate(local_val) => {
927924
// We need to make an allocation.

0 commit comments

Comments
 (0)