@@ -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 }
@@ -1020,8 +1020,8 @@ impl<'test> TestCx<'test> {
10201020
10211021 self . compose_and_run (
10221022 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 ( ) ) ,
10251025 None ,
10261026 )
10271027 }
@@ -1035,8 +1035,8 @@ impl<'test> TestCx<'test> {
10351035
10361036 self . compose_and_run (
10371037 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 ( ) ) ,
10401040 None ,
10411041 )
10421042 }
@@ -1050,8 +1050,8 @@ impl<'test> TestCx<'test> {
10501050
10511051 self . compose_and_run (
10521052 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 ( ) ) ,
10551055 None ,
10561056 )
10571057 }
@@ -1197,8 +1197,8 @@ impl<'test> TestCx<'test> {
11971197 self . props . unset_rustc_env . iter ( ) . fold ( & mut rustc, Command :: env_remove) ;
11981198 self . compose_and_run (
11991199 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 ( ) ) ,
12021202 input,
12031203 )
12041204 }
@@ -1219,8 +1219,7 @@ impl<'test> TestCx<'test> {
12191219 rustc. args ( & [ "--crate-type" , "rlib" ] ) ;
12201220 rustc. arg ( "-Cpanic=abort" ) ;
12211221
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 ) ;
12241223 if !res. status . success ( ) {
12251224 self . fatal_proc_rec (
12261225 & format ! (
@@ -1332,8 +1331,8 @@ impl<'test> TestCx<'test> {
13321331
13331332 let auxres = aux_cx. compose_and_run (
13341333 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 ( ) ) ,
13371336 None ,
13381337 ) ;
13391338 if !auxres. status . success ( ) {
@@ -1373,8 +1372,8 @@ impl<'test> TestCx<'test> {
13731372 fn compose_and_run (
13741373 & self ,
13751374 mut command : Command ,
1376- lib_path : & str ,
1377- aux_path : Option < & str > ,
1375+ lib_path : & Path ,
1376+ aux_path : Option < & Path > ,
13781377 input : Option < String > ,
13791378 ) -> ProcRes {
13801379 let cmdline = {
@@ -1806,7 +1805,7 @@ impl<'test> TestCx<'test> {
18061805 }
18071806 }
18081807
1809- fn make_cmdline ( & self , command : & Command , libpath : & str ) -> String {
1808+ fn make_cmdline ( & self , command : & Command , libpath : & Path ) -> String {
18101809 use crate :: util;
18111810
18121811 // Linux and mac don't require adjusting the library search path
@@ -1819,7 +1818,7 @@ impl<'test> TestCx<'test> {
18191818 format ! ( "{}=\" {}\" " , util:: lib_path_env_var( ) , util:: make_new_path( path) )
18201819 }
18211820
1822- format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath) , command)
1821+ format ! ( "{} {:?}" , lib_path_cmd_prefix( libpath. to_str ( ) . unwrap ( ) ) , command)
18231822 }
18241823 }
18251824
@@ -1980,7 +1979,8 @@ impl<'test> TestCx<'test> {
19801979 // Add custom flags supplied by the `filecheck-flags:` test header.
19811980 filecheck. args ( & self . props . filecheck_flags ) ;
19821981
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 )
19841984 }
19851985
19861986 fn charset ( ) -> & ' static str {
0 commit comments