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