@@ -8,6 +8,7 @@ use std::task::Poll;
8
8
use std:: thread;
9
9
10
10
use log:: info;
11
+ use rustc_middle:: ty:: Ty ;
11
12
12
13
use crate :: borrow_tracker:: RetagFields ;
13
14
use crate :: diagnostics:: report_leaks;
@@ -304,17 +305,19 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
304
305
for arg in config. args . iter ( ) {
305
306
// Make space for `0` terminator.
306
307
let size = u64:: try_from ( arg. len ( ) ) . unwrap ( ) . checked_add ( 1 ) . unwrap ( ) ;
307
- let arg_type = tcx . mk_array ( tcx. types . u8 , size) ;
308
+ let arg_type = Ty :: new_array ( tcx , tcx. types . u8 , size) ;
308
309
let arg_place =
309
310
ecx. allocate ( ecx. layout_of ( arg_type) ?, MiriMemoryKind :: Machine . into ( ) ) ?;
310
311
ecx. write_os_str_to_c_str ( OsStr :: new ( arg) , arg_place. ptr , size) ?;
311
312
ecx. mark_immutable ( & arg_place) ;
312
313
argvs. push ( arg_place. to_ref ( & ecx) ) ;
313
314
}
314
315
// Make an array with all these pointers, in the Miri memory.
315
- let argvs_layout = ecx. layout_of (
316
- tcx. mk_array ( tcx. mk_imm_ptr ( tcx. types . u8 ) , u64:: try_from ( argvs. len ( ) ) . unwrap ( ) ) ,
317
- ) ?;
316
+ let argvs_layout = ecx. layout_of ( Ty :: new_array (
317
+ tcx,
318
+ Ty :: new_imm_ptr ( tcx, tcx. types . u8 ) ,
319
+ u64:: try_from ( argvs. len ( ) ) . unwrap ( ) ,
320
+ ) ) ?;
318
321
let argvs_place = ecx. allocate ( argvs_layout, MiriMemoryKind :: Machine . into ( ) ) ?;
319
322
for ( idx, arg) in argvs. into_iter ( ) . enumerate ( ) {
320
323
let place = ecx. mplace_field ( & argvs_place, idx) ?;
@@ -332,7 +335,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
332
335
ecx. machine . argc = Some ( * argc_place) ;
333
336
334
337
let argv_place = ecx. allocate (
335
- ecx. layout_of ( tcx . mk_imm_ptr ( tcx. types . unit ) ) ?,
338
+ ecx. layout_of ( Ty :: new_imm_ptr ( tcx , tcx. types . unit ) ) ?,
336
339
MiriMemoryKind :: Machine . into ( ) ,
337
340
) ?;
338
341
ecx. write_immediate ( argv, & argv_place. into ( ) ) ?;
@@ -344,7 +347,8 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
344
347
// Construct a command string with all the arguments.
345
348
let cmd_utf16: Vec < u16 > = args_to_utf16_command_string ( config. args . iter ( ) ) ;
346
349
347
- let cmd_type = tcx. mk_array ( tcx. types . u16 , u64:: try_from ( cmd_utf16. len ( ) ) . unwrap ( ) ) ;
350
+ let cmd_type =
351
+ Ty :: new_array ( tcx, tcx. types . u16 , u64:: try_from ( cmd_utf16. len ( ) ) . unwrap ( ) ) ;
348
352
let cmd_place =
349
353
ecx. allocate ( ecx. layout_of ( cmd_type) ?, MiriMemoryKind :: Machine . into ( ) ) ?;
350
354
ecx. machine . cmd_line = Some ( * cmd_place) ;
0 commit comments