@@ -135,9 +135,9 @@ pub enum MiriMemoryKind {
135
135
Mmap ,
136
136
}
137
137
138
- impl From < MiriMemoryKind > for MemoryKind < MiriMemoryKind > {
138
+ impl From < MiriMemoryKind > for MemoryKind {
139
139
#[ inline( always) ]
140
- fn from ( kind : MiriMemoryKind ) -> MemoryKind < MiriMemoryKind > {
140
+ fn from ( kind : MiriMemoryKind ) -> MemoryKind {
141
141
MemoryKind :: Machine ( kind)
142
142
}
143
143
}
@@ -185,6 +185,8 @@ impl fmt::Display for MiriMemoryKind {
185
185
}
186
186
}
187
187
188
+ pub type MemoryKind = interpret:: MemoryKind < MiriMemoryKind > ;
189
+
188
190
/// Pointer provenance.
189
191
#[ derive( Clone , Copy ) ]
190
192
pub enum Provenance {
@@ -863,10 +865,8 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
863
865
type ProvenanceExtra = ProvenanceExtra ;
864
866
type Bytes = Box < [ u8 ] > ;
865
867
866
- type MemoryMap = MonoHashMap <
867
- AllocId ,
868
- ( MemoryKind < MiriMemoryKind > , Allocation < Provenance , Self :: AllocExtra , Self :: Bytes > ) ,
869
- > ;
868
+ type MemoryMap =
869
+ MonoHashMap < AllocId , ( MemoryKind , Allocation < Provenance , Self :: AllocExtra , Self :: Bytes > ) > ;
870
870
871
871
const GLOBAL_KIND : Option < MiriMemoryKind > = Some ( MiriMemoryKind :: Global ) ;
872
872
@@ -1088,7 +1088,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
1088
1088
ecx : & MiriInterpCx < ' mir , ' tcx > ,
1089
1089
id : AllocId ,
1090
1090
alloc : Cow < ' b , Allocation > ,
1091
- kind : Option < MemoryKind < Self :: MemoryKind > > ,
1091
+ kind : Option < MemoryKind > ,
1092
1092
) -> InterpResult < ' tcx , Cow < ' b , Allocation < Self :: Provenance , Self :: AllocExtra > > > {
1093
1093
let kind = kind. expect ( "we set our STATIC_KIND so this cannot be None" ) ;
1094
1094
if ecx. machine . tracked_alloc_ids . contains ( & id) {
@@ -1280,6 +1280,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
1280
1280
( alloc_id, prove_extra) : ( AllocId , Self :: ProvenanceExtra ) ,
1281
1281
size : Size ,
1282
1282
align : Align ,
1283
+ _kind : MemoryKind ,
1283
1284
) -> InterpResult < ' tcx > {
1284
1285
if machine. tracked_alloc_ids . contains ( & alloc_id) {
1285
1286
machine. emit_diagnostic ( NonHaltingDiagnostic :: FreedAlloc ( alloc_id) ) ;
0 commit comments