@@ -30,6 +30,7 @@ use super::{
30
30
AllocId , Allocation , InterpCx , MPlaceTy , Machine , MemoryKind , PlaceTy , err_ub, interp_ok,
31
31
} ;
32
32
use crate :: const_eval;
33
+ use crate :: const_eval:: DummyMachine ;
33
34
use crate :: errors:: NestedStaticInThreadLocal ;
34
35
35
36
pub trait CompileTimeMachine < ' tcx , T > = Machine <
@@ -323,14 +324,17 @@ pub fn intern_const_alloc_for_constprop<'tcx, T, M: CompileTimeMachine<'tcx, T>>
323
324
interp_ok ( ( ) )
324
325
}
325
326
326
- impl < ' tcx , M : super :: intern :: CompileTimeMachine < ' tcx , ! > > InterpCx < ' tcx , M > {
327
+ impl < ' tcx > InterpCx < ' tcx , DummyMachine > {
327
328
/// A helper function that allocates memory for the layout given and gives you access to mutate
328
329
/// it. Once your own mutation code is done, the backing `Allocation` is removed from the
329
330
/// current `Memory` and interned as read-only into the global memory.
330
331
pub fn intern_with_temp_alloc (
331
332
& mut self ,
332
333
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 , ( ) > ,
334
338
) -> InterpResult < ' tcx , AllocId > {
335
339
// `allocate` picks a fresh AllocId that we will associate with its data below.
336
340
let dest = self . allocate ( layout, MemoryKind :: Stack ) ?;
0 commit comments