File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 12
12
13
13
pub use self :: FileMatch :: * ;
14
14
15
+ use std:: borrow:: Cow ;
15
16
use std:: collections:: HashSet ;
16
17
use std:: env;
17
18
use std:: fs;
@@ -123,7 +124,7 @@ impl<'a> FileSearch<'a> {
123
124
// Returns a list of directories where target-specific tool binaries are located.
124
125
pub fn get_tools_search_paths ( & self ) -> Vec < PathBuf > {
125
126
let mut p = PathBuf :: from ( self . sysroot ) ;
126
- p. push ( & find_libdir ( self . sysroot ) ) ;
127
+ p. push ( find_libdir ( self . sysroot ) . as_ref ( ) ) ;
127
128
p. push ( RUST_LIB_DIR ) ;
128
129
p. push ( & self . triple ) ;
129
130
p. push ( "bin" ) ;
@@ -132,7 +133,7 @@ impl<'a> FileSearch<'a> {
132
133
}
133
134
134
135
pub fn relative_target_lib_path ( sysroot : & Path , target_triple : & str ) -> PathBuf {
135
- let mut p = PathBuf :: from ( & find_libdir ( sysroot) ) ;
136
+ let mut p = PathBuf :: from ( find_libdir ( sysroot) . as_ref ( ) ) ;
136
137
assert ! ( p. is_relative( ) ) ;
137
138
p. push ( RUST_LIB_DIR ) ;
138
139
p. push ( target_triple) ;
@@ -166,7 +167,7 @@ pub fn get_or_default_sysroot() -> PathBuf {
166
167
}
167
168
168
169
// The name of the directory rustc expects libraries to be located.
169
- fn find_libdir ( sysroot : & Path ) -> String {
170
+ fn find_libdir ( sysroot : & Path ) -> Cow < ' static , str > {
170
171
// FIXME: This is a quick hack to make the rustc binary able to locate
171
172
// Rust libraries in Linux environments where libraries might be installed
172
173
// to lib64/lib32. This would be more foolproof by basing the sysroot off
You can’t perform that action at this time.
0 commit comments