@@ -81,7 +81,7 @@ impl VisitTags for FrameExtra {
81
81
/// Extra global state, available to the memory access hooks.
82
82
#[ derive( Debug ) ]
83
83
pub struct GlobalStateInner {
84
- /// Borrow tracker method currently in use (except BorrowTrackerMethod::Off)
84
+ /// Borrow tracker method currently in use.
85
85
pub borrow_tracker_method : BorrowTrackerMethod ,
86
86
/// Next unused pointer ID (tag).
87
87
pub next_ptr_tag : BorTag ,
@@ -183,11 +183,6 @@ impl GlobalStateInner {
183
183
}
184
184
}
185
185
186
- /// Return the borrow tracker method
187
- pub fn method ( & self ) -> BorrowTrackerMethod {
188
- self . borrow_tracker_method
189
- }
190
-
191
186
/// Generates a new pointer tag. Remember to also check track_pointer_tags and log its creation!
192
187
pub fn new_ptr ( & mut self ) -> BorTag {
193
188
let id = self . next_ptr_tag ;
@@ -272,23 +267,23 @@ impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir,
272
267
pub trait EvalContextExt < ' mir , ' tcx : ' mir > : crate :: MiriInterpCxExt < ' mir , ' tcx > {
273
268
fn retag ( & mut self , kind : RetagKind , place : & PlaceTy < ' tcx , Provenance > ) -> InterpResult < ' tcx > {
274
269
let this = self . eval_context_mut ( ) ;
275
- let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . method ( ) ;
270
+ let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
276
271
match method {
277
272
BorrowTrackerMethod :: StackedBorrows => this. sb_retag ( kind, place) ,
278
273
}
279
274
}
280
275
281
276
fn retag_return_place ( & mut self ) -> InterpResult < ' tcx > {
282
277
let this = self . eval_context_mut ( ) ;
283
- let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . method ( ) ;
278
+ let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
284
279
match method {
285
280
BorrowTrackerMethod :: StackedBorrows => this. sb_retag_return_place ( ) ,
286
281
}
287
282
}
288
283
289
284
fn expose_tag ( & mut self , alloc_id : AllocId , tag : BorTag ) -> InterpResult < ' tcx > {
290
285
let this = self . eval_context_mut ( ) ;
291
- let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . method ( ) ;
286
+ let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
292
287
match method {
293
288
BorrowTrackerMethod :: StackedBorrows => this. sb_expose_tag ( alloc_id, tag) ,
294
289
}
0 commit comments