@@ -50,8 +50,8 @@ pub enum MiriMemoryKind {
5050 WinHeap ,
5151 /// Memory for env vars and args, errno, extern statics and other parts of the machine-managed environment.
5252 Machine ,
53- /// Rust statics .
54- Static ,
53+ /// Globals copied from `tcx` .
54+ Global ,
5555}
5656
5757impl Into < MemoryKind < MiriMemoryKind > > for MiriMemoryKind {
@@ -212,7 +212,7 @@ impl<'mir, 'tcx> MiriEvalContextExt<'mir, 'tcx> for MiriEvalContext<'mir, 'tcx>
212212
213213/// Machine hook implementations.
214214impl < ' mir , ' tcx > Machine < ' mir , ' tcx > for Evaluator < ' tcx > {
215- type MemoryKinds = MiriMemoryKind ;
215+ type MemoryKind = MiriMemoryKind ;
216216
217217 type FrameExtra = FrameData < ' tcx > ;
218218 type MemoryExtra = MemoryExtra ;
@@ -223,7 +223,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
223223 type MemoryMap =
224224 MonoHashMap < AllocId , ( MemoryKind < MiriMemoryKind > , Allocation < Tag , Self :: AllocExtra > ) > ;
225225
226- const STATIC_KIND : Option < MiriMemoryKind > = Some ( MiriMemoryKind :: Static ) ;
226+ const GLOBAL_KIND : Option < MiriMemoryKind > = Some ( MiriMemoryKind :: Global ) ;
227227
228228 const CHECK_ALIGN : bool = true ;
229229
@@ -348,7 +348,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
348348 memory_extra : & MemoryExtra ,
349349 id : AllocId ,
350350 alloc : Cow < ' b , Allocation > ,
351- kind : Option < MemoryKind < Self :: MemoryKinds > > ,
351+ kind : Option < MemoryKind < Self :: MemoryKind > > ,
352352 ) -> ( Cow < ' b , Allocation < Self :: PointerTag , Self :: AllocExtra > > , Self :: PointerTag ) {
353353 if Some ( id) == memory_extra. tracked_alloc_id {
354354 register_diagnostic ( NonHaltingDiagnostic :: CreatedAlloc ( id) ) ;
@@ -369,9 +369,9 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
369369 let alloc: Allocation < Tag , Self :: AllocExtra > = alloc. with_tags_and_extra (
370370 |alloc| {
371371 if let Some ( stacked_borrows) = stacked_borrows. as_mut ( ) {
372- // Only statics may already contain pointers at this point
373- assert_eq ! ( kind, MiriMemoryKind :: Static . into( ) ) ;
374- stacked_borrows. static_base_ptr ( alloc)
372+ // Only globals may already contain pointers at this point
373+ assert_eq ! ( kind, MiriMemoryKind :: Global . into( ) ) ;
374+ stacked_borrows. global_base_ptr ( alloc)
375375 } else {
376376 Tag :: Untagged
377377 }
@@ -382,9 +382,9 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
382382 }
383383
384384 #[ inline( always) ]
385- fn tag_static_base_pointer ( memory_extra : & MemoryExtra , id : AllocId ) -> Self :: PointerTag {
385+ fn tag_global_base_pointer ( memory_extra : & MemoryExtra , id : AllocId ) -> Self :: PointerTag {
386386 if let Some ( stacked_borrows) = memory_extra. stacked_borrows . as_ref ( ) {
387- stacked_borrows. borrow_mut ( ) . static_base_ptr ( id)
387+ stacked_borrows. borrow_mut ( ) . global_base_ptr ( id)
388388 } else {
389389 Tag :: Untagged
390390 }
@@ -486,7 +486,7 @@ impl MayLeak for MiriMemoryKind {
486486 use self :: MiriMemoryKind :: * ;
487487 match self {
488488 Rust | C | WinHeap => false ,
489- Machine | Static => true ,
489+ Machine | Global => true ,
490490 }
491491 }
492492}
0 commit comments