@@ -112,8 +112,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
112
112
113
113
// Querying system information
114
114
"GetSystemInfo" => {
115
- use crate :: rustc_middle:: ty:: { layout:: LayoutOf , TyKind , UintTy } ;
116
-
117
115
let [ system_info] =
118
116
this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
119
117
let system_info = this. deref_operand ( system_info) ?;
@@ -123,16 +121,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
123
121
iter:: repeat ( 0u8 ) . take ( system_info. layout . size . bytes ( ) as usize ) ,
124
122
) ?;
125
123
// Set selected fields.
126
- let word_ty = this. tcx . mk_ty ( TyKind :: Uint ( UintTy :: U16 ) ) ;
127
- let dword_ty = this. tcx . mk_ty ( TyKind :: Uint ( UintTy :: U32 ) ) ;
128
- let usize_ty = this. tcx . mk_ty ( TyKind :: Uint ( UintTy :: Usize ) ) ;
129
- let word_layout = this. layout_of ( word_ty) ?;
130
- let dword_layout = this. layout_of ( dword_ty) ?;
131
- let usize_layout = this. layout_of ( usize_ty) ?;
124
+ let word_layout = this. machine . layouts . u16 ;
125
+ let dword_layout = this. machine . layouts . u32 ;
126
+ let usize_layout = this. machine . layouts . usize ;
132
127
133
128
// Using `mplace_field` is error-prone, see: https://github.com/rust-lang/miri/issues/2136.
134
129
// Pointer fields have different sizes on different targets.
135
- // To avoid all these issue we calculate the offsets dynamically .
130
+ // To avoid all these issue we calculate the offsets ourselves .
136
131
let field_sizes = [
137
132
word_layout. size , // 0, wProcessorArchitecture : WORD
138
133
word_layout. size , // 1, wReserved : WORD
0 commit comments