@@ -488,7 +488,7 @@ impl<'tcx> Stack {
488
488
& mut self ,
489
489
derived_from : ProvenanceExtra ,
490
490
new : Item ,
491
- global : & mut GlobalStateInner ,
491
+ global : & GlobalStateInner ,
492
492
dcx : & mut DiagnosticCx < ' _ , ' _ , ' _ , ' _ , ' tcx > ,
493
493
exposed_tags : & FxHashSet < SbTag > ,
494
494
) -> InterpResult < ' tcx > {
@@ -658,9 +658,9 @@ impl Stacks {
658
658
range. size. bytes( )
659
659
) ;
660
660
let dcx = DiagnosticCxBuilder :: read ( & mut current_span, threads, tag, range) ;
661
- let mut state = state. borrow_mut ( ) ;
661
+ let state = state. borrow ( ) ;
662
662
self . for_each ( range, dcx, |stack, dcx, exposed_tags| {
663
- stack. access ( AccessKind :: Read , tag, & mut state, dcx, exposed_tags)
663
+ stack. access ( AccessKind :: Read , tag, & state, dcx, exposed_tags)
664
664
} )
665
665
}
666
666
@@ -681,9 +681,9 @@ impl Stacks {
681
681
range. size. bytes( )
682
682
) ;
683
683
let dcx = DiagnosticCxBuilder :: write ( & mut current_span, threads, tag, range) ;
684
- let mut state = state. borrow_mut ( ) ;
684
+ let state = state. borrow ( ) ;
685
685
self . for_each ( range, dcx, |stack, dcx, exposed_tags| {
686
- stack. access ( AccessKind :: Write , tag, & mut state, dcx, exposed_tags)
686
+ stack. access ( AccessKind :: Write , tag, & state, dcx, exposed_tags)
687
687
} )
688
688
}
689
689
@@ -904,7 +904,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
904
904
false
905
905
} ;
906
906
let item = Item :: new ( new_tag, perm, protected) ;
907
- let mut global = this. machine . stacked_borrows . as_ref ( ) . unwrap ( ) . borrow_mut ( ) ;
907
+ let global = this. machine . stacked_borrows . as_ref ( ) . unwrap ( ) . borrow ( ) ;
908
908
let dcx = DiagnosticCxBuilder :: retag (
909
909
& mut current_span, // FIXME avoid this `clone`
910
910
& this. machine . threads ,
@@ -914,7 +914,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
914
914
alloc_range ( base_offset, size) ,
915
915
) ;
916
916
stacked_borrows. for_each ( range, dcx, |stack, dcx, exposed_tags| {
917
- stack. grant ( orig_tag, item, & mut global, dcx, exposed_tags)
917
+ stack. grant ( orig_tag, item, & global, dcx, exposed_tags)
918
918
} )
919
919
} ) ?;
920
920
return Ok ( Some ( alloc_id) ) ;
@@ -932,7 +932,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
932
932
. borrow_mut ( ) ;
933
933
let item = Item :: new ( new_tag, perm, protect. is_some ( ) ) ;
934
934
let range = alloc_range ( base_offset, size) ;
935
- let mut global = machine. stacked_borrows . as_ref ( ) . unwrap ( ) . borrow_mut ( ) ;
935
+ let global = machine. stacked_borrows . as_ref ( ) . unwrap ( ) . borrow ( ) ;
936
936
// FIXME: can't share this with the current_span inside log_creation
937
937
let current_span = & mut machine. current_span ( ) ;
938
938
let dcx = DiagnosticCxBuilder :: retag (
@@ -944,7 +944,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
944
944
alloc_range ( base_offset, size) ,
945
945
) ;
946
946
stacked_borrows. for_each ( range, dcx, |stack, dcx, exposed_tags| {
947
- stack. grant ( orig_tag, item, & mut global, dcx, exposed_tags)
947
+ stack. grant ( orig_tag, item, & global, dcx, exposed_tags)
948
948
} ) ?;
949
949
950
950
Ok ( Some ( alloc_id) )
0 commit comments