Skip to content

Commit 192fd3d

Browse files
Vytautas AstrauskasRalfJung
Vytautas Astrauskas
authored andcommitted
Move stack and stack_mut implementation in Machine to match their position in the trait.
1 parent 5224c72 commit 192fd3d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/machine.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -326,20 +326,6 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
326326
memory_extra.check_alignment
327327
}
328328

329-
#[inline(always)]
330-
fn stack<'a>(
331-
ecx: &'a InterpCx<'mir, 'tcx, Self>,
332-
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>] {
333-
&ecx.machine.stack
334-
}
335-
336-
#[inline(always)]
337-
fn stack_mut<'a>(
338-
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
339-
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>> {
340-
&mut ecx.machine.stack
341-
}
342-
343329
#[inline(always)]
344330
fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
345331
ecx.machine.validate
@@ -539,6 +525,20 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
539525
Ok(frame.with_extra(extra))
540526
}
541527

528+
#[inline(always)]
529+
fn stack<'a>(
530+
ecx: &'a InterpCx<'mir, 'tcx, Self>,
531+
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>] {
532+
&ecx.machine.stack
533+
}
534+
535+
#[inline(always)]
536+
fn stack_mut<'a>(
537+
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
538+
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>> {
539+
&mut ecx.machine.stack
540+
}
541+
542542
#[inline(always)]
543543
fn after_stack_push(ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
544544
if ecx.memory.extra.stacked_borrows.is_some() {

0 commit comments

Comments
 (0)