@@ -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,7 +305,7 @@ 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) ?;
@@ -313,7 +314,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
313
314
}
314
315
// Make an array with all these pointers, in the Miri memory.
315
316
let argvs_layout = ecx. layout_of (
316
- tcx . mk_array ( tcx. mk_imm_ptr ( tcx. types . u8 ) , u64:: try_from ( argvs. len ( ) ) . unwrap ( ) ) ,
317
+ Ty :: new_array ( tcx, Ty :: new_imm_ptr ( tcx , tcx. types . u8 ) , u64:: try_from ( argvs. len ( ) ) . unwrap ( ) ) ,
317
318
) ?;
318
319
let argvs_place = ecx. allocate ( argvs_layout, MiriMemoryKind :: Machine . into ( ) ) ?;
319
320
for ( idx, arg) in argvs. into_iter ( ) . enumerate ( ) {
@@ -332,7 +333,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
332
333
ecx. machine . argc = Some ( * argc_place) ;
333
334
334
335
let argv_place = ecx. allocate (
335
- ecx. layout_of ( tcx . mk_imm_ptr ( tcx. types . unit ) ) ?,
336
+ ecx. layout_of ( Ty :: new_imm_ptr ( tcx , tcx. types . unit ) ) ?,
336
337
MiriMemoryKind :: Machine . into ( ) ,
337
338
) ?;
338
339
ecx. write_immediate ( argv, & argv_place. into ( ) ) ?;
@@ -344,7 +345,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
344
345
// Construct a command string with all the arguments.
345
346
let cmd_utf16: Vec < u16 > = args_to_utf16_command_string ( config. args . iter ( ) ) ;
346
347
347
- let cmd_type = tcx . mk_array ( tcx. types . u16 , u64:: try_from ( cmd_utf16. len ( ) ) . unwrap ( ) ) ;
348
+ let cmd_type = Ty :: new_array ( tcx , tcx. types . u16 , u64:: try_from ( cmd_utf16. len ( ) ) . unwrap ( ) ) ;
348
349
let cmd_place =
349
350
ecx. allocate ( ecx. layout_of ( cmd_type) ?, MiriMemoryKind :: Machine . into ( ) ) ?;
350
351
ecx. machine . cmd_line = Some ( * cmd_place) ;
0 commit comments