@@ -18,6 +18,7 @@ use syntax::abi::Abi;
18
18
use error:: { EvalError , EvalResult } ;
19
19
use lvalue:: { Global , GlobalId , Lvalue , LvalueExtra } ;
20
20
use memory:: { Memory , MemoryPointer , TlsKey , HasMemory } ;
21
+ use memory:: Kind as MemoryKind ;
21
22
use operator;
22
23
use value:: { PrimVal , PrimValKind , Value , Pointer } ;
23
24
@@ -153,7 +154,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
153
154
) -> EvalResult < ' tcx , MemoryPointer > {
154
155
let size = self . type_size_with_substs ( ty, substs) ?. expect ( "cannot alloc memory for unsized type" ) ;
155
156
let align = self . type_align_with_substs ( ty, substs) ?;
156
- self . memory . allocate ( size, align, :: memory :: Kind :: Stack )
157
+ self . memory . allocate ( size, align, MemoryKind :: Stack )
157
158
}
158
159
159
160
pub fn memory ( & self ) -> & Memory < ' a , ' tcx > {
@@ -417,8 +418,8 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
417
418
// for a constant like `const FOO: &i32 = &1;` the local containing
418
419
// the `1` is referred to by the global. We transitively marked everything
419
420
// the global refers to as static itself, so we don't free it here
420
- :: memory :: Kind :: Static => { }
421
- :: memory :: Kind :: Stack => self . memory . deallocate ( ptr, None , :: memory :: Kind :: Stack ) ?,
421
+ MemoryKind :: Static => { }
422
+ MemoryKind :: Stack => self . memory . deallocate ( ptr, None , MemoryKind :: Stack ) ?,
422
423
other => bug ! ( "local contained non-stack memory: {:?}" , other) ,
423
424
}
424
425
} ;
@@ -696,7 +697,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
696
697
self . write_primval ( dest, PrimVal :: Bytes ( align. into ( ) ) , dest_ty) ?;
697
698
} else {
698
699
let align = self . type_align ( ty) ?;
699
- let ptr = self . memory . allocate ( size, align, :: memory :: Kind :: Rust ) ?;
700
+ let ptr = self . memory . allocate ( size, align, MemoryKind :: Rust ) ?;
700
701
self . write_primval ( dest, PrimVal :: Ptr ( ptr) , dest_ty) ?;
701
702
}
702
703
}
@@ -1689,7 +1690,7 @@ pub fn eval_main<'a, 'tcx: 'a>(
1689
1690
}
1690
1691
1691
1692
// Return value
1692
- let ret_ptr = ecx. memory . allocate ( ecx. tcx . data_layout . pointer_size . bytes ( ) , ecx. tcx . data_layout . pointer_align . abi ( ) , :: memory :: Kind :: Stack ) ?;
1693
+ let ret_ptr = ecx. memory . allocate ( ecx. tcx . data_layout . pointer_size . bytes ( ) , ecx. tcx . data_layout . pointer_align . abi ( ) , MemoryKind :: Stack ) ?;
1693
1694
cleanup_ptr = Some ( ret_ptr) ;
1694
1695
1695
1696
// Push our stack frame
@@ -1731,7 +1732,7 @@ pub fn eval_main<'a, 'tcx: 'a>(
1731
1732
1732
1733
while ecx. step ( ) ? { }
1733
1734
if let Some ( cleanup_ptr) = cleanup_ptr {
1734
- ecx. memory . deallocate ( cleanup_ptr, None , :: memory :: Kind :: Stack ) ?;
1735
+ ecx. memory . deallocate ( cleanup_ptr, None , MemoryKind :: Stack ) ?;
1735
1736
}
1736
1737
return Ok ( ( ) ) ;
1737
1738
}
0 commit comments