Skip to content

Commit a64c1fd

Browse files
committed
Auto merge of #2719 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 2713dbd + bb7c9e7 commit a64c1fd

File tree

6 files changed

+249
-178
lines changed

6 files changed

+249
-178
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
203c8765ea33c65d888febe0e8219c4bb11b0d89
1+
7701a7e7d4eed74a106f39fa64899dffd1e1025f

src/borrow_tracker/mod.rs

+18-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use rustc_target::abi::Size;
1111

1212
use crate::*;
1313
pub mod stacked_borrows;
14-
use stacked_borrows::diagnostics::RetagCause;
1514

1615
pub type CallId = NonZeroU64;
1716

@@ -265,11 +264,27 @@ impl GlobalStateInner {
265264

266265
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
267266
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
268-
fn retag(&mut self, kind: RetagKind, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx> {
267+
fn retag_ptr_value(
268+
&mut self,
269+
kind: RetagKind,
270+
val: &ImmTy<'tcx, Provenance>,
271+
) -> InterpResult<'tcx, ImmTy<'tcx, Provenance>> {
272+
let this = self.eval_context_mut();
273+
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
274+
match method {
275+
BorrowTrackerMethod::StackedBorrows => this.sb_retag_ptr_value(kind, val),
276+
}
277+
}
278+
279+
fn retag_place_contents(
280+
&mut self,
281+
kind: RetagKind,
282+
place: &PlaceTy<'tcx, Provenance>,
283+
) -> InterpResult<'tcx> {
269284
let this = self.eval_context_mut();
270285
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
271286
match method {
272-
BorrowTrackerMethod::StackedBorrows => this.sb_retag(kind, place),
287+
BorrowTrackerMethod::StackedBorrows => this.sb_retag_place_contents(kind, place),
273288
}
274289
}
275290

src/borrow_tracker/stacked_borrows/diagnostics.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,12 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
459459
Operation::Dealloc(_) => format!(" due to deallocation"),
460460
Operation::Access(AccessOp { kind, tag, .. }) =>
461461
format!(" due to {kind:?} access for {tag:?}"),
462-
Operation::Retag(RetagOp { orig_tag, permission, .. }) => {
462+
Operation::Retag(RetagOp { orig_tag, permission, new_tag, .. }) => {
463463
let permission = permission
464464
.expect("start_grant should set the current permission before popping a tag");
465-
format!(" due to {permission:?} retag from {orig_tag:?}")
465+
format!(
466+
" due to {permission:?} retag from {orig_tag:?} (that retag created {new_tag:?})"
467+
)
466468
}
467469
};
468470

0 commit comments

Comments
 (0)