@@ -15,11 +15,12 @@ static TEST_TRIPLE_2: &str = "i686-unknown-hurd-gnu";
15
15
static TEST_TRIPLE_3 : & str = "i686-unknown-netbsd" ;
16
16
17
17
fn configure ( cmd : & str , host : & [ & str ] , target : & [ & str ] ) -> Config {
18
- configure_with_args ( & [ cmd. to_owned ( ) ] , host, target)
18
+ configure_with_args ( & [ cmd] , host, target)
19
19
}
20
20
21
- fn configure_with_args ( cmd : & [ String ] , host : & [ & str ] , target : & [ & str ] ) -> Config {
22
- let mut config = Config :: parse ( Flags :: parse ( cmd) ) ;
21
+ fn configure_with_args ( cmd : & [ & str ] , host : & [ & str ] , target : & [ & str ] ) -> Config {
22
+ let cmd = cmd. iter ( ) . copied ( ) . map ( String :: from) . collect :: < Vec < _ > > ( ) ;
23
+ let mut config = Config :: parse ( Flags :: parse ( & cmd) ) ;
23
24
// don't save toolstates
24
25
config. save_toolstates = None ;
25
26
config. set_dry_run ( DryRun :: SelfCheck ) ;
@@ -67,7 +68,7 @@ fn run_build(paths: &[PathBuf], config: Config) -> Cache {
67
68
fn check_cli < const N : usize > ( paths : [ & str ; N ] ) {
68
69
run_build (
69
70
& paths. map ( PathBuf :: from) ,
70
- configure_with_args ( & paths. map ( String :: from ) , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ,
71
+ configure_with_args ( & paths, & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ,
71
72
) ;
72
73
}
73
74
@@ -1000,8 +1001,7 @@ mod sysroot_target_dirs {
1000
1001
/// cg_gcc tests instead.
1001
1002
#[ test]
1002
1003
fn test_test_compiler ( ) {
1003
- let cmd = & [ "test" , "compiler" ] . map ( str:: to_owned) ;
1004
- let config = configure_with_args ( cmd, & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
1004
+ let config = configure_with_args ( & [ "test" , "compiler" ] , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
1005
1005
let cache = run_build ( & config. paths . clone ( ) , config) ;
1006
1006
1007
1007
let compiler = cache. contains :: < test:: CrateLibrustc > ( ) ;
@@ -1034,8 +1034,7 @@ fn test_test_coverage() {
1034
1034
// Print each test case so that if one fails, the most recently printed
1035
1035
// case is the one that failed.
1036
1036
println ! ( "Testing case: {cmd:?}" ) ;
1037
- let cmd = cmd. iter ( ) . copied ( ) . map ( str:: to_owned) . collect :: < Vec < _ > > ( ) ;
1038
- let config = configure_with_args ( & cmd, & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
1037
+ let config = configure_with_args ( cmd, & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
1039
1038
let mut cache = run_build ( & config. paths . clone ( ) , config) ;
1040
1039
1041
1040
let modes =
@@ -1207,8 +1206,7 @@ fn test_get_tool_rustc_compiler() {
1207
1206
/// of `Any { .. }`.
1208
1207
#[ test]
1209
1208
fn step_cycle_debug ( ) {
1210
- let cmd = [ "run" , "cyclic-step" ] . map ( str:: to_owned) ;
1211
- let config = configure_with_args ( & cmd, & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
1209
+ let config = configure_with_args ( & [ "run" , "cyclic-step" ] , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
1212
1210
1213
1211
let err = panic:: catch_unwind ( || run_build ( & config. paths . clone ( ) , config) ) . unwrap_err ( ) ;
1214
1212
let err = err. downcast_ref :: < String > ( ) . unwrap ( ) . as_str ( ) ;
0 commit comments