type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
const STATIC_KIND: Option<!> = None; // no copying of statics allowed
- const ENABLE_PTR_TRACKING_HOOKS: bool = false; // we don't have no provenance
#[inline(always)]
fn enforce_validity(_ecx: &EvalContext<'a, 'mir, 'tcx, Self>) -> bool {
/// that is added to the memory so that the work is not done twice.
const STATIC_KIND: Option<Self::MemoryKinds>;
- /// As an optimization, you can prevent the pointer tracking hooks from ever being
- /// called. You should only do this if you do not care about provenance tracking.
- /// This controls the `tag_reference` and `tag_dereference` hooks.
- const ENABLE_PTR_TRACKING_HOOKS: bool;
-
/// Whether to enforce the validity invariant
fn enforce_validity(ecx: &EvalContext<'a, 'mir, 'tcx, Self>) -> bool;
let mplace = MemPlace { ptr, align, meta };
let mut mplace = MPlaceTy { mplace, layout };
// Pointer tag tracking might want to adjust the tag.
- if M::ENABLE_PTR_TRACKING_HOOKS {
- let mutbl = match val.layout.ty.sty {
- // `builtin_deref` considers boxes immutable, that's useless for our purposes
- ty::Ref(_, _, mutbl) => Some(mutbl),
- ty::Adt(def, _) if def.is_box() => Some(hir::MutMutable),
- ty::RawPtr(_) => None,
- _ => bug!("Unexpected pointer type {}", val.layout.ty.sty),
- };
- mplace.mplace.ptr = M::tag_dereference(self, mplace, mutbl)?;
- }
+ let mutbl = match val.layout.ty.sty {
+ // `builtin_deref` considers boxes immutable, that's useless for our purposes
+ ty::Ref(_, _, mutbl) => Some(mutbl),
+ ty::Adt(def, _) if def.is_box() => Some(hir::MutMutable),
+ ty::RawPtr(_) => None,
+ _ => bug!("Unexpected pointer type {}", val.layout.ty.sty),
+ };
+ mplace.mplace.ptr = M::tag_dereference(self, mplace, mutbl)?;
// Done
Ok(mplace)
}