impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
- fn retag_ptr_value(&mut self, kind: RetagKind, val: &ImmTy<'tcx, Provenance>) -> InterpResult<'tcx, ImmTy<'tcx, Provenance>> {
+ fn retag_ptr_value(
+ &mut self,
+ kind: RetagKind,
+ val: &ImmTy<'tcx, Provenance>,
+ ) -> InterpResult<'tcx, ImmTy<'tcx, Provenance>> {
let this = self.eval_context_mut();
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
match method {
}
}
- fn retag_place_contents(&mut self, kind: RetagKind, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx> {
+ fn retag_place_contents(
+ &mut self,
+ kind: RetagKind,
+ place: &PlaceTy<'tcx, Provenance>,
+ ) -> InterpResult<'tcx> {
let this = self.eval_context_mut();
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
match method {
Operation::Retag(RetagOp { orig_tag, permission, new_tag, .. }) => {
let permission = permission
.expect("start_grant should set the current permission before popping a tag");
- format!(" due to {permission:?} retag from {orig_tag:?} (that retag created {new_tag:?})")
+ format!(
+ " due to {permission:?} retag from {orig_tag:?} (that retag created {new_tag:?})"
+ )
}
};
use rustc_middle::ty::{
self,
layout::{HasParamEnv, LayoutOf},
+ Ty,
};
use rustc_target::abi::{Abi, Size};
/// A key function: determine the permissions to grant at a retag for the given kind of
/// reference/pointer.
fn from_ref_ty<'tcx>(
- ty: ty::Ty<'tcx>,
+ ty: Ty<'tcx>,
kind: RetagKind,
cx: &crate::MiriInterpCx<'_, 'tcx>,
) -> Self {
RetagKind::FnEntry => unreachable!(),
RetagKind::Raw | RetagKind::Default => RetagCause::Normal,
};
- this.sb_retag_reference(&val, new_perm, retag_cause)
+ this.sb_retag_reference(val, new_perm, retag_cause)
}
fn sb_retag_place_contents(
let msg = match &e {
CreatedPointerTag(tag, None, _) => format!("created base tag {tag:?}"),
- CreatedPointerTag(tag, Some(perm), None) => format!("created {tag:?} with {perm} derived from unknown tag"),
+ CreatedPointerTag(tag, Some(perm), None) =>
+ format!("created {tag:?} with {perm} derived from unknown tag"),
CreatedPointerTag(tag, Some(perm), Some((alloc_id, range, orig_tag))) =>
format!(
"created tag {tag:?} with {perm} at {alloc_id:?}{range:?} derived from {orig_tag:?}"
ptr: Pointer<Self::Provenance>,
) -> InterpResult<'tcx> {
match ptr.provenance {
- Provenance::Concrete { alloc_id, tag } => {
- intptrcast::GlobalStateInner::expose_ptr(ecx, alloc_id, tag)
- }
+ Provenance::Concrete { alloc_id, tag } =>
+ intptrcast::GlobalStateInner::expose_ptr(ecx, alloc_id, tag),
Provenance::Wildcard => {
// No need to do anything for wildcard pointers as
// their provenances have already been previously exposed.