@@ -122,13 +122,6 @@ impl VisitProvenance for GlobalStateInner {
122
122
/// We need interior mutable access to the global state.
123
123
pub type GlobalState = RefCell < GlobalStateInner > ;
124
124
125
- /// Indicates which kind of access is being performed.
126
- #[ derive( Copy , Clone , Hash , PartialEq , Eq , Debug ) ]
127
- pub enum AccessKind {
128
- Read ,
129
- Write ,
130
- }
131
-
132
125
impl fmt:: Display for AccessKind {
133
126
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
134
127
match self {
@@ -384,7 +377,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
384
377
if matches ! ( kind, AllocKind :: LiveData ) {
385
378
let alloc_extra = this. get_alloc_extra ( * alloc_id) ?; // can still fail for `extern static`
386
379
let alloc_borrow_tracker = & alloc_extra. borrow_tracker . as_ref ( ) . unwrap ( ) ;
387
- alloc_borrow_tracker. release_protector ( & this. machine , borrow_tracker, * tag) ?;
380
+ alloc_borrow_tracker. release_protector (
381
+ & this. machine ,
382
+ borrow_tracker,
383
+ * tag,
384
+ * alloc_id,
385
+ ) ?;
388
386
}
389
387
}
390
388
borrow_tracker. borrow_mut ( ) . end_call ( & frame. extra ) ;
@@ -498,10 +496,12 @@ impl AllocState {
498
496
machine : & MiriMachine < ' _ , ' tcx > ,
499
497
global : & GlobalState ,
500
498
tag : BorTag ,
499
+ alloc_id : AllocId , // diagnostics
501
500
) -> InterpResult < ' tcx > {
502
501
match self {
503
502
AllocState :: StackedBorrows ( _sb) => Ok ( ( ) ) ,
504
- AllocState :: TreeBorrows ( tb) => tb. borrow_mut ( ) . release_protector ( machine, global, tag) ,
503
+ AllocState :: TreeBorrows ( tb) =>
504
+ tb. borrow_mut ( ) . release_protector ( machine, global, tag, alloc_id) ,
505
505
}
506
506
}
507
507
}
0 commit comments