@@ -12,15 +12,15 @@ use tracing::debug;
1212pub struct FileSearch < ' a > {
1313 sysroot : & ' a Path ,
1414 triple : & ' a str ,
15- search_paths : & ' a [ SearchPath ] ,
15+ cli_search_paths : & ' a [ SearchPath ] ,
1616 tlib_path : & ' a SearchPath ,
1717 kind : PathKind ,
1818}
1919
2020impl < ' a > FileSearch < ' a > {
2121 pub fn search_paths ( & self ) -> impl Iterator < Item = & ' a SearchPath > {
2222 let kind = self . kind ;
23- self . search_paths
23+ self . cli_search_paths
2424 . iter ( )
2525 . filter ( move |sp| sp. kind . matches ( kind) )
2626 . chain ( std:: iter:: once ( self . tlib_path ) )
@@ -37,26 +37,26 @@ impl<'a> FileSearch<'a> {
3737 pub fn new (
3838 sysroot : & ' a Path ,
3939 triple : & ' a str ,
40- search_paths : & ' a [ SearchPath ] ,
40+ cli_search_paths : & ' a [ SearchPath ] ,
4141 tlib_path : & ' a SearchPath ,
4242 kind : PathKind ,
4343 ) -> FileSearch < ' a > {
4444 debug ! ( "using sysroot = {}, triple = {}" , sysroot. display( ) , triple) ;
45- FileSearch { sysroot, triple, search_paths , tlib_path, kind }
45+ FileSearch { sysroot, triple, cli_search_paths , tlib_path, kind }
4646 }
4747}
4848
4949pub fn make_target_lib_path ( sysroot : & Path , target_triple : & str ) -> PathBuf {
50- let rustlib_path = rustc_target:: target_rustlib_path ( sysroot, target_triple) ;
51- PathBuf :: from_iter ( [ sysroot, Path :: new ( & rustlib_path) , Path :: new ( "lib" ) ] )
50+ let rustlib_path = rustc_target:: relative_target_rustlib_path ( sysroot, target_triple) ;
51+ sysroot. join ( rustlib_path) . join ( "lib" )
5252}
5353
5454/// Returns a path to the target's `bin` folder within its `rustlib` path in the sysroot. This is
5555/// where binaries are usually installed, e.g. the self-contained linkers, lld-wrappers, LLVM tools,
5656/// etc.
5757pub fn make_target_bin_path ( sysroot : & Path , target_triple : & str ) -> PathBuf {
58- let rustlib_path = rustc_target:: target_rustlib_path ( sysroot, target_triple) ;
59- PathBuf :: from_iter ( [ sysroot, Path :: new ( & rustlib_path) , Path :: new ( "bin" ) ] )
58+ let rustlib_path = rustc_target:: relative_target_rustlib_path ( sysroot, target_triple) ;
59+ sysroot. join ( rustlib_path) . join ( "bin" )
6060}
6161
6262#[ cfg( unix) ]
@@ -275,7 +275,7 @@ pub fn get_or_default_sysroot() -> Result<PathBuf, String> {
275275 p. pop ( ) ;
276276 p. pop ( ) ;
277277 // Look for the target rustlib directory in the suspected sysroot.
278- let mut rustlib_path = rustc_target:: target_rustlib_path ( & p, "dummy" ) ;
278+ let mut rustlib_path = rustc_target:: relative_target_rustlib_path ( & p, "dummy" ) ;
279279 rustlib_path. pop ( ) ; // pop off the dummy target.
280280 rustlib_path. exists ( ) . then_some ( p)
281281 }
0 commit comments