@@ -12,15 +12,15 @@ use tracing::debug;
12
12
pub struct FileSearch < ' a > {
13
13
sysroot : & ' a Path ,
14
14
triple : & ' a str ,
15
- search_paths : & ' a [ SearchPath ] ,
15
+ cli_search_paths : & ' a [ SearchPath ] ,
16
16
tlib_path : & ' a SearchPath ,
17
17
kind : PathKind ,
18
18
}
19
19
20
20
impl < ' a > FileSearch < ' a > {
21
21
pub fn search_paths ( & self ) -> impl Iterator < Item = & ' a SearchPath > {
22
22
let kind = self . kind ;
23
- self . search_paths
23
+ self . cli_search_paths
24
24
. iter ( )
25
25
. filter ( move |sp| sp. kind . matches ( kind) )
26
26
. chain ( std:: iter:: once ( self . tlib_path ) )
@@ -37,26 +37,26 @@ impl<'a> FileSearch<'a> {
37
37
pub fn new (
38
38
sysroot : & ' a Path ,
39
39
triple : & ' a str ,
40
- search_paths : & ' a [ SearchPath ] ,
40
+ cli_search_paths : & ' a [ SearchPath ] ,
41
41
tlib_path : & ' a SearchPath ,
42
42
kind : PathKind ,
43
43
) -> FileSearch < ' a > {
44
44
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 }
46
46
}
47
47
}
48
48
49
49
pub 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" )
52
52
}
53
53
54
54
/// Returns a path to the target's `bin` folder within its `rustlib` path in the sysroot. This is
55
55
/// where binaries are usually installed, e.g. the self-contained linkers, lld-wrappers, LLVM tools,
56
56
/// etc.
57
57
pub 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" )
60
60
}
61
61
62
62
#[ cfg( unix) ]
@@ -275,7 +275,7 @@ pub fn get_or_default_sysroot() -> Result<PathBuf, String> {
275
275
p. pop ( ) ;
276
276
p. pop ( ) ;
277
277
// 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" ) ;
279
279
rustlib_path. pop ( ) ; // pop off the dummy target.
280
280
rustlib_path. exists ( ) . then_some ( p)
281
281
}
0 commit comments