@@ -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
}
@@ -1020,8 +1020,8 @@ impl<'test> TestCx<'test> {
1020
1020
1021
1021
self . compose_and_run (
1022
1022
test_client,
1023
- self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1024
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1023
+ self . config . run_lib_path . as_path ( ) ,
1024
+ Some ( aux_dir. as_path ( ) ) ,
1025
1025
None ,
1026
1026
)
1027
1027
}
@@ -1035,8 +1035,8 @@ impl<'test> TestCx<'test> {
1035
1035
1036
1036
self . compose_and_run (
1037
1037
wr_run,
1038
- self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1039
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1038
+ self . config . run_lib_path . as_path ( ) ,
1039
+ Some ( aux_dir. as_path ( ) ) ,
1040
1040
None ,
1041
1041
)
1042
1042
}
@@ -1050,8 +1050,8 @@ impl<'test> TestCx<'test> {
1050
1050
1051
1051
self . compose_and_run (
1052
1052
program,
1053
- self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1054
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1053
+ self . config . run_lib_path . as_path ( ) ,
1054
+ Some ( aux_dir. as_path ( ) ) ,
1055
1055
None ,
1056
1056
)
1057
1057
}
@@ -1197,8 +1197,8 @@ impl<'test> TestCx<'test> {
1197
1197
self . props . unset_rustc_env . iter ( ) . fold ( & mut rustc, Command :: env_remove) ;
1198
1198
self . compose_and_run (
1199
1199
rustc,
1200
- self . config . compile_lib_path . to_str ( ) . unwrap ( ) ,
1201
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1200
+ self . config . compile_lib_path . as_path ( ) ,
1201
+ Some ( aux_dir. as_path ( ) ) ,
1202
1202
input,
1203
1203
)
1204
1204
}
@@ -1219,8 +1219,7 @@ impl<'test> TestCx<'test> {
1219
1219
rustc. args ( & [ "--crate-type" , "rlib" ] ) ;
1220
1220
rustc. arg ( "-Cpanic=abort" ) ;
1221
1221
1222
- let res =
1223
- self . compose_and_run ( rustc, self . config . compile_lib_path . to_str ( ) . unwrap ( ) , None , None ) ;
1222
+ let res = self . compose_and_run ( rustc, self . config . compile_lib_path . as_path ( ) , None , None ) ;
1224
1223
if !res. status . success ( ) {
1225
1224
self . fatal_proc_rec (
1226
1225
& format ! (
@@ -1332,8 +1331,8 @@ impl<'test> TestCx<'test> {
1332
1331
1333
1332
let auxres = aux_cx. compose_and_run (
1334
1333
aux_rustc,
1335
- aux_cx. config . compile_lib_path . to_str ( ) . unwrap ( ) ,
1336
- Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1334
+ aux_cx. config . compile_lib_path . as_path ( ) ,
1335
+ Some ( aux_dir. as_path ( ) ) ,
1337
1336
None ,
1338
1337
) ;
1339
1338
if !auxres. status . success ( ) {
@@ -1373,8 +1372,8 @@ impl<'test> TestCx<'test> {
1373
1372
fn compose_and_run (
1374
1373
& self ,
1375
1374
mut command : Command ,
1376
- lib_path : & str ,
1377
- aux_path : Option < & str > ,
1375
+ lib_path : & Path ,
1376
+ aux_path : Option < & Path > ,
1378
1377
input : Option < String > ,
1379
1378
) -> ProcRes {
1380
1379
let cmdline = {
@@ -1806,7 +1805,7 @@ impl<'test> TestCx<'test> {
1806
1805
}
1807
1806
}
1808
1807
1809
- fn make_cmdline ( & self , command : & Command , libpath : & str ) -> String {
1808
+ fn make_cmdline ( & self , command : & Command , libpath : & Path ) -> String {
1810
1809
use crate :: util;
1811
1810
1812
1811
// Linux and mac don't require adjusting the library search path
@@ -1819,7 +1818,7 @@ impl<'test> TestCx<'test> {
1819
1818
format ! ( "{}=\" {}\" " , util:: lib_path_env_var( ) , util:: make_new_path( path) )
1820
1819
}
1821
1820
1822
- format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath) , command)
1821
+ format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath. to_str ( ) . unwrap ( ) ) , command)
1823
1822
}
1824
1823
}
1825
1824
@@ -1980,7 +1979,8 @@ impl<'test> TestCx<'test> {
1980
1979
// Add custom flags supplied by the `filecheck-flags:` test header.
1981
1980
filecheck. args ( & self . props . filecheck_flags ) ;
1982
1981
1983
- self . compose_and_run ( filecheck, "" , None , None )
1982
+ // FIXME(jieyouxu): don't pass an empty Path
1983
+ self . compose_and_run ( filecheck, Path :: new ( "" ) , None , None )
1984
1984
}
1985
1985
1986
1986
fn charset ( ) -> & ' static str {
0 commit comments