@@ -445,8 +445,8 @@ impl<'test> TestCx<'test> {
445
445
446
446
self . compose_and_run (
447
447
rustc,
448
- self . config . compile_lib_path . to_str ( ) . unwrap ( ) ,
449
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
448
+ self . config . compile_lib_path . as_path ( ) ,
449
+ Some ( aux_dir. as_path ( ) ) ,
450
450
src,
451
451
)
452
452
}
@@ -1022,8 +1022,8 @@ impl<'test> TestCx<'test> {
1022
1022
1023
1023
self . compose_and_run (
1024
1024
test_client,
1025
- self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1026
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1025
+ self . config . run_lib_path . as_path ( ) ,
1026
+ Some ( aux_dir. as_path ( ) ) ,
1027
1027
None ,
1028
1028
)
1029
1029
}
@@ -1037,8 +1037,8 @@ impl<'test> TestCx<'test> {
1037
1037
1038
1038
self . compose_and_run (
1039
1039
wr_run,
1040
- self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1041
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1040
+ self . config . run_lib_path . as_path ( ) ,
1041
+ Some ( aux_dir. as_path ( ) ) ,
1042
1042
None ,
1043
1043
)
1044
1044
}
@@ -1052,8 +1052,8 @@ impl<'test> TestCx<'test> {
1052
1052
1053
1053
self . compose_and_run (
1054
1054
program,
1055
- self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1056
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1055
+ self . config . run_lib_path . as_path ( ) ,
1056
+ Some ( aux_dir. as_path ( ) ) ,
1057
1057
None ,
1058
1058
)
1059
1059
}
@@ -1199,8 +1199,8 @@ impl<'test> TestCx<'test> {
1199
1199
self . props . unset_rustc_env . iter ( ) . fold ( & mut rustc, Command :: env_remove) ;
1200
1200
self . compose_and_run (
1201
1201
rustc,
1202
- self . config . compile_lib_path . to_str ( ) . unwrap ( ) ,
1203
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1202
+ self . config . compile_lib_path . as_path ( ) ,
1203
+ Some ( aux_dir. as_path ( ) ) ,
1204
1204
input,
1205
1205
)
1206
1206
}
@@ -1221,8 +1221,7 @@ impl<'test> TestCx<'test> {
1221
1221
rustc. args ( & [ "--crate-type" , "rlib" ] ) ;
1222
1222
rustc. arg ( "-Cpanic=abort" ) ;
1223
1223
1224
- let res =
1225
- self . compose_and_run ( rustc, self . config . compile_lib_path . to_str ( ) . unwrap ( ) , None , None ) ;
1224
+ let res = self . compose_and_run ( rustc, self . config . compile_lib_path . as_path ( ) , None , None ) ;
1226
1225
if !res. status . success ( ) {
1227
1226
self . fatal_proc_rec (
1228
1227
& format ! (
@@ -1334,8 +1333,8 @@ impl<'test> TestCx<'test> {
1334
1333
1335
1334
let auxres = aux_cx. compose_and_run (
1336
1335
aux_rustc,
1337
- aux_cx. config . compile_lib_path . to_str ( ) . unwrap ( ) ,
1338
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1336
+ aux_cx. config . compile_lib_path . as_path ( ) ,
1337
+ Some ( aux_dir. as_path ( ) ) ,
1339
1338
None ,
1340
1339
) ;
1341
1340
if !auxres. status . success ( ) {
@@ -1375,8 +1374,8 @@ impl<'test> TestCx<'test> {
1375
1374
fn compose_and_run (
1376
1375
& self ,
1377
1376
mut command : Command ,
1378
- lib_path : & str ,
1379
- aux_path : Option < & str > ,
1377
+ lib_path : & Path ,
1378
+ aux_path : Option < & Path > ,
1380
1379
input : Option < String > ,
1381
1380
) -> ProcRes {
1382
1381
let cmdline = {
@@ -1808,7 +1807,7 @@ impl<'test> TestCx<'test> {
1808
1807
}
1809
1808
}
1810
1809
1811
- fn make_cmdline ( & self , command : & Command , libpath : & str ) -> String {
1810
+ fn make_cmdline ( & self , command : & Command , libpath : & Path ) -> String {
1812
1811
use crate :: util;
1813
1812
1814
1813
// Linux and mac don't require adjusting the library search path
@@ -1821,7 +1820,7 @@ impl<'test> TestCx<'test> {
1821
1820
format ! ( "{}=\" {}\" " , util:: lib_path_env_var( ) , util:: make_new_path( path) )
1822
1821
}
1823
1822
1824
- format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath) , command)
1823
+ format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath. to_str ( ) . unwrap ( ) ) , command)
1825
1824
}
1826
1825
}
1827
1826
@@ -1982,7 +1981,8 @@ impl<'test> TestCx<'test> {
1982
1981
// Add custom flags supplied by the `filecheck-flags:` test header.
1983
1982
filecheck. args ( & self . props . filecheck_flags ) ;
1984
1983
1985
- self . compose_and_run ( filecheck, "" , None , None )
1984
+ // FIXME(jieyouxu): don't pass an empty Path
1985
+ self . compose_and_run ( filecheck, Path :: new ( "" ) , None , None )
1986
1986
}
1987
1987
1988
1988
fn charset ( ) -> & ' static str {
0 commit comments