Skip to content

Commit 345a8d5

Browse files
Move CtfeMemory alias next to CompileTimeInterpreter
1 parent 26b9146 commit 345a8d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_mir/const_eval.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ impl interpret::MayLeak for ! {
305305
}
306306
}
307307

308+
pub type CtfeMemory<'mir, 'tcx> = Memory<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>>;
309+
308310
impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, 'tcx> {
309311
type MemoryKinds = !;
310312
type PointerTag = ();
@@ -445,7 +447,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
445447
}
446448

447449
fn ptr_to_int(
448-
_mem: &Memory<'mir, 'tcx, Self>,
450+
_mem: &CtfeMemory<'mir, 'tcx>,
449451
_ptr: Pointer,
450452
) -> InterpResult<'tcx, u64> {
451453
Err(

src/librustc_mir/interpret/snapshot.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ use rustc::ty::layout::Size;
6363
use rustc_data_structures::fx::{FxHasher, FxHashMap, FxHashSet};
6464

6565
use super::{memory, AllocId, Frame, Immediate, MemPlace, Operand};
66-
use crate::const_eval::CompileTimeInterpreter;
66+
use crate::const_eval::{CompileTimeInterpreter, CtfeMemory};
6767
use crate::interpret::{LocalState, LocalValue};
6868

69-
type CtfeMemory<'mir, 'tcx> = Memory<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>>;
70-
7169
#[derive(Default)]
7270
pub(crate) struct InfiniteLoopDetector<'mir, 'tcx> {
7371
/// The set of all `InterpSnapshot` *hashes* observed by this detector.

0 commit comments

Comments
 (0)