@@ -305,17 +305,19 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
305305 for arg in config. args . iter ( ) {
306306 // Make space for `0` terminator.
307307 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) ;
309309 let arg_place =
310310 ecx. allocate ( ecx. layout_of ( arg_type) ?, MiriMemoryKind :: Machine . into ( ) ) ?;
311311 ecx. write_os_str_to_c_str ( OsStr :: new ( arg) , arg_place. ptr , size) ?;
312312 ecx. mark_immutable ( & arg_place) ;
313313 argvs. push ( arg_place. to_ref ( & ecx) ) ;
314314 }
315315 // 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+ ) ) ?;
319321 let argvs_place = ecx. allocate ( argvs_layout, MiriMemoryKind :: Machine . into ( ) ) ?;
320322 for ( idx, arg) in argvs. into_iter ( ) . enumerate ( ) {
321323 let place = ecx. mplace_field ( & argvs_place, idx) ?;
@@ -333,7 +335,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
333335 ecx. machine . argc = Some ( * argc_place) ;
334336
335337 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 ) ) ?,
337339 MiriMemoryKind :: Machine . into ( ) ,
338340 ) ?;
339341 ecx. write_immediate ( argv, & argv_place. into ( ) ) ?;
@@ -345,7 +347,8 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
345347 // Construct a command string with all the arguments.
346348 let cmd_utf16: Vec < u16 > = args_to_utf16_command_string ( config. args . iter ( ) ) ;
347349
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 ( ) ) ;
349352 let cmd_place =
350353 ecx. allocate ( ecx. layout_of ( cmd_type) ?, MiriMemoryKind :: Machine . into ( ) ) ?;
351354 ecx. machine . cmd_line = Some ( * cmd_place) ;
0 commit comments