Function rustc_const_eval::interpret::intern::intern_shallow
source · fn intern_shallow<'rt, 'mir, 'tcx, T, M: CompileTimeMachine<'mir, 'tcx, T>>(
ecx: &'rt mut InterpCx<'mir, 'tcx, M>,
alloc_id: AllocId,
mutability: Mutability,
recursive_alloc: impl FnMut(&InterpCx<'mir, 'tcx, M>, CtfeProvenance)
) -> Result<(), ()>Expand description
Intern an allocation. Returns Err if the allocation does not exist in the local memory.
mutability can be used to force immutable interning: if it is Mutability::Not, the
allocation is interned immutably; if it is Mutability::Mut, then the allocation must be
already mutable (as a sanity check).
recursive_alloc is called for all recursively encountered allocations.