Skip to content
/ rust Public
forked from rust-lang/rust

Commit 99a60eb

Browse files
committed
intern_with_temp_alloc is for DummyMachine only.
1 parent 675360a commit 99a60eb

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+6
-2
lines changed

compiler/rustc_const_eval/src/interpret/intern.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use super::{
3030
AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy, err_ub, interp_ok,
3131
};
3232
use crate::const_eval;
33+
use crate::const_eval::DummyMachine;
3334
use crate::errors::NestedStaticInThreadLocal;
3435

3536
pub trait CompileTimeMachine<'tcx, T> = Machine<
@@ -323,14 +324,17 @@ pub fn intern_const_alloc_for_constprop<'tcx, T, M: CompileTimeMachine<'tcx, T>>
323324
interp_ok(())
324325
}
325326

326-
impl<'tcx, M: super::intern::CompileTimeMachine<'tcx, !>> InterpCx<'tcx, M> {
327+
impl<'tcx> InterpCx<'tcx, DummyMachine> {
327328
/// A helper function that allocates memory for the layout given and gives you access to mutate
328329
/// it. Once your own mutation code is done, the backing `Allocation` is removed from the
329330
/// current `Memory` and interned as read-only into the global memory.
330331
pub fn intern_with_temp_alloc(
331332
&mut self,
332333
layout: TyAndLayout<'tcx>,
333-
f: impl FnOnce(&mut InterpCx<'tcx, M>, &PlaceTy<'tcx, M::Provenance>) -> InterpResult<'tcx, ()>,
334+
f: impl FnOnce(
335+
&mut InterpCx<'tcx, DummyMachine>,
336+
&PlaceTy<'tcx, CtfeProvenance>,
337+
) -> InterpResult<'tcx, ()>,
334338
) -> InterpResult<'tcx, AllocId> {
335339
// `allocate` picks a fresh AllocId that we will associate with its data below.
336340
let dest = self.allocate(layout, MemoryKind::Stack)?;

0 commit comments

Comments
 (0)