@@ -11,7 +11,6 @@ use rustc_target::abi::Size;
11
11
12
12
use crate :: * ;
13
13
pub mod stacked_borrows;
14
- use stacked_borrows:: diagnostics:: RetagCause ;
15
14
16
15
pub type CallId = NonZeroU64 ;
17
16
@@ -265,11 +264,27 @@ impl GlobalStateInner {
265
264
266
265
impl < ' mir , ' tcx : ' mir > EvalContextExt < ' mir , ' tcx > for crate :: MiriInterpCx < ' mir , ' tcx > { }
267
266
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 > {
269
284
let this = self . eval_context_mut ( ) ;
270
285
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
271
286
match method {
272
- BorrowTrackerMethod :: StackedBorrows => this. sb_retag ( kind, place) ,
287
+ BorrowTrackerMethod :: StackedBorrows => this. sb_retag_place_contents ( kind, place) ,
273
288
}
274
289
}
275
290
0 commit comments