@@ -445,8 +445,8 @@ impl<'test> TestCx<'test> {
445445
446446 self . compose_and_run (
447447 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 ( ) ) ,
450450 src,
451451 )
452452 }
@@ -1022,8 +1022,8 @@ impl<'test> TestCx<'test> {
10221022
10231023 self . compose_and_run (
10241024 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 ( ) ) ,
10271027 None ,
10281028 )
10291029 }
@@ -1037,8 +1037,8 @@ impl<'test> TestCx<'test> {
10371037
10381038 self . compose_and_run (
10391039 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 ( ) ) ,
10421042 None ,
10431043 )
10441044 }
@@ -1052,8 +1052,8 @@ impl<'test> TestCx<'test> {
10521052
10531053 self . compose_and_run (
10541054 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 ( ) ) ,
10571057 None ,
10581058 )
10591059 }
@@ -1199,8 +1199,8 @@ impl<'test> TestCx<'test> {
11991199 self . props . unset_rustc_env . iter ( ) . fold ( & mut rustc, Command :: env_remove) ;
12001200 self . compose_and_run (
12011201 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 ( ) ) ,
12041204 input,
12051205 )
12061206 }
@@ -1221,8 +1221,7 @@ impl<'test> TestCx<'test> {
12211221 rustc. args ( & [ "--crate-type" , "rlib" ] ) ;
12221222 rustc. arg ( "-Cpanic=abort" ) ;
12231223
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 ) ;
12261225 if !res. status . success ( ) {
12271226 self . fatal_proc_rec (
12281227 & format ! (
@@ -1334,8 +1333,8 @@ impl<'test> TestCx<'test> {
13341333
13351334 let auxres = aux_cx. compose_and_run (
13361335 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 ( ) ) ,
13391338 None ,
13401339 ) ;
13411340 if !auxres. status . success ( ) {
@@ -1375,8 +1374,8 @@ impl<'test> TestCx<'test> {
13751374 fn compose_and_run (
13761375 & self ,
13771376 mut command : Command ,
1378- lib_path : & str ,
1379- aux_path : Option < & str > ,
1377+ lib_path : & Path ,
1378+ aux_path : Option < & Path > ,
13801379 input : Option < String > ,
13811380 ) -> ProcRes {
13821381 let cmdline = {
@@ -1808,7 +1807,7 @@ impl<'test> TestCx<'test> {
18081807 }
18091808 }
18101809
1811- fn make_cmdline ( & self , command : & Command , libpath : & str ) -> String {
1810+ fn make_cmdline ( & self , command : & Command , libpath : & Path ) -> String {
18121811 use crate :: util;
18131812
18141813 // Linux and mac don't require adjusting the library search path
@@ -1821,7 +1820,7 @@ impl<'test> TestCx<'test> {
18211820 format ! ( "{}=\" {}\" " , util:: lib_path_env_var( ) , util:: make_new_path( path) )
18221821 }
18231822
1824- format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath) , command)
1823+ format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath. to_str ( ) . unwrap ( ) ) , command)
18251824 }
18261825 }
18271826
@@ -1982,7 +1981,8 @@ impl<'test> TestCx<'test> {
19821981 // Add custom flags supplied by the `filecheck-flags:` test header.
19831982 filecheck. args ( & self . props . filecheck_flags ) ;
19841983
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 )
19861986 }
19871987
19881988 fn charset ( ) -> & ' static str {
0 commit comments