@@ -365,45 +365,35 @@ actual:\n\
365
365
}
366
366
367
367
fn typecheck_source ( & self , src : String ) -> ProcRes {
368
- let args = self . make_typecheck_args ( ) ;
369
- self . compose_and_run_compiler ( args, Some ( src) )
370
- }
368
+ let mut rustc = Command :: new ( & self . config . rustc_path ) ;
369
+
370
+ let out_dir = self . output_base_name ( ) . with_extension ( "pretty-out" ) ;
371
+ let _ = fs:: remove_dir_all ( & out_dir) ;
372
+ create_dir_all ( & out_dir) . unwrap ( ) ;
371
373
372
- fn make_typecheck_args ( & self ) -> ProcArgs {
373
- let aux_dir = self . aux_output_dir_name ( ) ;
374
374
let target = if self . props . force_host {
375
375
& * self . config . host
376
376
} else {
377
377
& * self . config . target
378
378
} ;
379
379
380
- let out_dir = self . output_base_name ( ) . with_extension ( "pretty-out" ) ;
381
- let _ = fs:: remove_dir_all ( & out_dir) ;
382
- create_dir_all ( & out_dir) . unwrap ( ) ;
380
+ let aux_dir = self . aux_output_dir_name ( ) ;
381
+
382
+ rustc. arg ( "-" )
383
+ . arg ( "-Zno-trans" )
384
+ . arg ( "--out-dir" ) . arg ( & out_dir)
385
+ . arg ( & format ! ( "--target={}" , target) )
386
+ . arg ( "-L" ) . arg ( & self . config . build_base )
387
+ . arg ( "-L" ) . arg ( aux_dir) ;
383
388
384
- // FIXME (#9639): This needs to handle non-utf8 paths
385
- let mut args = vec ! [ "-" . to_owned( ) ,
386
- "-Zno-trans" . to_owned( ) ,
387
- "--out-dir" . to_owned( ) ,
388
- out_dir. to_str( ) . unwrap( ) . to_owned( ) ,
389
- format!( "--target={}" , target) ,
390
- "-L" . to_owned( ) ,
391
- self . config. build_base. to_str( ) . unwrap( ) . to_owned( ) ,
392
- "-L" . to_owned( ) ,
393
- aux_dir. to_str( ) . unwrap( ) . to_owned( ) ] ;
394
389
if let Some ( revision) = self . revision {
395
- args. extend ( vec ! [
396
- "--cfg" . to_string( ) ,
397
- revision. to_string( ) ,
398
- ] ) ;
399
- }
400
- args. extend ( self . split_maybe_args ( & self . config . target_rustcflags ) ) ;
401
- args. extend ( self . props . compile_flags . iter ( ) . cloned ( ) ) ;
402
- // FIXME (#9639): This needs to handle non-utf8 paths
403
- ProcArgs {
404
- prog : self . config . rustc_path . to_str ( ) . unwrap ( ) . to_owned ( ) ,
405
- args,
390
+ rustc. args ( & [ "--cfg" , revision] ) ;
406
391
}
392
+
393
+ rustc. args ( self . split_maybe_args ( & self . config . target_rustcflags ) ) ;
394
+ rustc. args ( & self . props . compile_flags ) ;
395
+
396
+ self . compose_and_run_compiler ( rustc, Some ( src) )
407
397
}
408
398
409
399
fn run_debuginfo_gdb_test ( & self ) {
@@ -1126,10 +1116,11 @@ actual:\n\
1126
1116
}
1127
1117
_ => { }
1128
1118
}
1129
- let args = self . make_compile_args ( extra_args,
1130
- & self . testpaths . file ,
1131
- TargetLocation :: ThisFile ( self . make_exe_name ( ) ) ) ;
1132
- self . compose_and_run_compiler ( args, None )
1119
+ let ProcArgs { prog, args } = self . make_compile_args (
1120
+ extra_args, & self . testpaths . file , TargetLocation :: ThisFile ( self . make_exe_name ( ) ) ) ;
1121
+ let mut rustc = Command :: new ( prog) ;
1122
+ rustc. args ( args) ;
1123
+ self . compose_and_run_compiler ( rustc, None )
1133
1124
}
1134
1125
1135
1126
fn document ( & self , out_dir : & Path ) -> ProcRes {
@@ -1153,18 +1144,16 @@ actual:\n\
1153
1144
}
1154
1145
1155
1146
let aux_dir = self . aux_output_dir_name ( ) ;
1156
- let mut args = vec ! [ "-L" . to_owned( ) ,
1157
- aux_dir. to_str( ) . unwrap( ) . to_owned( ) ,
1158
- "-o" . to_owned( ) ,
1159
- out_dir. to_str( ) . unwrap( ) . to_owned( ) ,
1160
- self . testpaths. file. to_str( ) . unwrap( ) . to_owned( ) ] ;
1161
- args. extend ( self . props . compile_flags . iter ( ) . cloned ( ) ) ;
1162
- let args = ProcArgs {
1163
- prog : self . config . rustdoc_path
1164
- . as_ref ( ) . expect ( "--rustdoc-path passed" ) . to_str ( ) . unwrap ( ) . to_owned ( ) ,
1165
- args,
1166
- } ;
1167
- self . compose_and_run_compiler ( args, None )
1147
+
1148
+ let rustdoc_path = self . config . rustdoc_path . as_ref ( ) . expect ( "--rustdoc-path passed" ) ;
1149
+ let mut rustdoc = Command :: new ( rustdoc_path) ;
1150
+
1151
+ rustdoc. arg ( "-L" ) . arg ( aux_dir)
1152
+ . arg ( "-o" ) . arg ( out_dir)
1153
+ . arg ( & self . testpaths . file )
1154
+ . args ( & self . props . compile_flags ) ;
1155
+
1156
+ self . compose_and_run_compiler ( rustdoc, None )
1168
1157
}
1169
1158
1170
1159
fn exec_compiled_test ( & self ) -> ProcRes {
@@ -1247,7 +1236,7 @@ actual:\n\
1247
1236
}
1248
1237
}
1249
1238
1250
- fn compose_and_run_compiler ( & self , args : ProcArgs , input : Option < String > ) -> ProcRes {
1239
+ fn compose_and_run_compiler ( & self , mut rustc : Command , input : Option < String > ) -> ProcRes {
1251
1240
if !self . props . aux_builds . is_empty ( ) {
1252
1241
create_dir_all ( & self . aux_output_dir_name ( ) ) . unwrap ( ) ;
1253
1242
}
@@ -1307,11 +1296,7 @@ actual:\n\
1307
1296
}
1308
1297
}
1309
1298
1310
- let ProcArgs { prog, args } = args;
1311
- let mut rustc = Command :: new ( prog) ;
1312
- rustc. args ( args)
1313
- . envs ( self . props . rustc_env . clone ( ) ) ;
1314
-
1299
+ rustc. envs ( self . props . rustc_env . clone ( ) ) ;
1315
1300
self . compose_and_run ( rustc,
1316
1301
self . config . compile_lib_path . to_str ( ) . unwrap ( ) ,
1317
1302
Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
@@ -1681,7 +1666,10 @@ actual:\n\
1681
1666
self . output_base_name ( ) . parent ( )
1682
1667
. unwrap ( )
1683
1668
. to_path_buf ( ) ) ) ;
1684
- self . compose_and_run_compiler ( args, None )
1669
+ let ProcArgs { prog, args } = args;
1670
+ let mut rustc = Command :: new ( prog) ;
1671
+ rustc. args ( args) ;
1672
+ self . compose_and_run_compiler ( rustc, None )
1685
1673
}
1686
1674
1687
1675
fn check_ir_with_filecheck ( & self ) -> ProcRes {
0 commit comments