@@ -122,13 +122,6 @@ impl VisitProvenance for GlobalStateInner {
122122/// We need interior mutable access to the global state.
123123pub type GlobalState = RefCell < GlobalStateInner > ;
124124
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-
132125impl fmt:: Display for AccessKind {
133126 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
134127 match self {
@@ -384,7 +377,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
384377 if matches ! ( kind, AllocKind :: LiveData ) {
385378 let alloc_extra = this. get_alloc_extra ( * alloc_id) ?; // can still fail for `extern static`
386379 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+ ) ?;
388386 }
389387 }
390388 borrow_tracker. borrow_mut ( ) . end_call ( & frame. extra ) ;
@@ -498,10 +496,12 @@ impl AllocState {
498496 machine : & MiriMachine < ' _ , ' tcx > ,
499497 global : & GlobalState ,
500498 tag : BorTag ,
499+ alloc_id : AllocId , // diagnostics
501500 ) -> InterpResult < ' tcx > {
502501 match self {
503502 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) ,
505505 }
506506 }
507507}
0 commit comments