@@ -254,8 +254,7 @@ impl ProvenanceExtra {
254254/// Extra per-allocation data
255255#[ derive( Debug , Clone ) ]
256256pub struct AllocExtra {
257- /// Stacked Borrows state. Although it is always added,
258- /// one of the implementations does nothing
257+ /// Global state of the borrow tracker, if enabled.
259258 pub borrow_tracker : Option < borrow_tracker:: AllocExtra > ,
260259 /// Data race detection via the use of a vector-clock,
261260 /// this is only added if it is enabled.
@@ -1061,9 +1060,8 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
10611060 kind : mir:: RetagKind ,
10621061 place : & PlaceTy < ' tcx , Provenance > ,
10631062 ) -> InterpResult < ' tcx > {
1064- if let Some ( borrow_tracker) = & ecx. machine . borrow_tracker {
1065- let method = borrow_tracker. borrow ( ) . method ( ) ;
1066- ecx. retag ( kind, place, method) ?;
1063+ if ecx. machine . borrow_tracker . is_some ( ) {
1064+ ecx. retag ( kind, place) ?;
10671065 }
10681066 Ok ( ( ) )
10691067 }
@@ -1150,9 +1148,8 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
11501148 let stack_len = ecx. active_thread_stack ( ) . len ( ) ;
11511149 ecx. active_thread_mut ( ) . set_top_user_relevant_frame ( stack_len - 1 ) ;
11521150 }
1153- if let Some ( borrow_tracker) = & ecx. machine . borrow_tracker {
1154- let method = borrow_tracker. borrow ( ) . method ( ) ;
1155- ecx. retag_return_place ( method) ?;
1151+ if ecx. machine . borrow_tracker . is_some ( ) {
1152+ ecx. retag_return_place ( ) ?;
11561153 }
11571154 Ok ( ( ) )
11581155 }
0 commit comments