@@ -11,7 +11,6 @@ use rustc_target::abi::Size;
1111
1212use crate :: * ;
1313pub mod stacked_borrows;
14- use stacked_borrows:: diagnostics:: RetagCause ;
1514
1615pub type CallId = NonZeroU64 ;
1716
@@ -265,11 +264,27 @@ impl GlobalStateInner {
265264
266265impl < ' mir , ' tcx : ' mir > EvalContextExt < ' mir , ' tcx > for crate :: MiriInterpCx < ' mir , ' tcx > { }
267266pub 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
0 commit comments