@@ -50,8 +50,8 @@ pub enum MiriMemoryKind {
50
50
WinHeap ,
51
51
/// Memory for env vars and args, errno, extern statics and other parts of the machine-managed environment.
52
52
Machine ,
53
- /// Rust statics .
54
- Static ,
53
+ /// Globals copied from `tcx` .
54
+ Global ,
55
55
}
56
56
57
57
impl Into < MemoryKind < MiriMemoryKind > > for MiriMemoryKind {
@@ -212,7 +212,7 @@ impl<'mir, 'tcx> MiriEvalContextExt<'mir, 'tcx> for MiriEvalContext<'mir, 'tcx>
212
212
213
213
/// Machine hook implementations.
214
214
impl < ' mir , ' tcx > Machine < ' mir , ' tcx > for Evaluator < ' tcx > {
215
- type MemoryKinds = MiriMemoryKind ;
215
+ type MemoryKind = MiriMemoryKind ;
216
216
217
217
type FrameExtra = FrameData < ' tcx > ;
218
218
type MemoryExtra = MemoryExtra ;
@@ -223,7 +223,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
223
223
type MemoryMap =
224
224
MonoHashMap < AllocId , ( MemoryKind < MiriMemoryKind > , Allocation < Tag , Self :: AllocExtra > ) > ;
225
225
226
- const STATIC_KIND : Option < MiriMemoryKind > = Some ( MiriMemoryKind :: Static ) ;
226
+ const GLOBAL_KIND : Option < MiriMemoryKind > = Some ( MiriMemoryKind :: Global ) ;
227
227
228
228
const CHECK_ALIGN : bool = true ;
229
229
@@ -348,7 +348,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
348
348
memory_extra : & MemoryExtra ,
349
349
id : AllocId ,
350
350
alloc : Cow < ' b , Allocation > ,
351
- kind : Option < MemoryKind < Self :: MemoryKinds > > ,
351
+ kind : Option < MemoryKind < Self :: MemoryKind > > ,
352
352
) -> ( Cow < ' b , Allocation < Self :: PointerTag , Self :: AllocExtra > > , Self :: PointerTag ) {
353
353
if Some ( id) == memory_extra. tracked_alloc_id {
354
354
register_diagnostic ( NonHaltingDiagnostic :: CreatedAlloc ( id) ) ;
@@ -369,9 +369,9 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
369
369
let alloc: Allocation < Tag , Self :: AllocExtra > = alloc. with_tags_and_extra (
370
370
|alloc| {
371
371
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)
375
375
} else {
376
376
Tag :: Untagged
377
377
}
@@ -382,9 +382,9 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
382
382
}
383
383
384
384
#[ 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 {
386
386
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)
388
388
} else {
389
389
Tag :: Untagged
390
390
}
@@ -486,7 +486,7 @@ impl MayLeak for MiriMemoryKind {
486
486
use self :: MiriMemoryKind :: * ;
487
487
match self {
488
488
Rust | C | WinHeap => false ,
489
- Machine | Static => true ,
489
+ Machine | Global => true ,
490
490
}
491
491
}
492
492
}
0 commit comments