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 1212
1313pub use self :: FileMatch :: * ;
1414
15+ use std:: borrow:: Cow ;
1516use std:: collections:: HashSet ;
1617use std:: env;
1718use std:: fs;
@@ -123,7 +124,7 @@ impl<'a> FileSearch<'a> {
123124 // Returns a list of directories where target-specific tool binaries are located.
124125 pub fn get_tools_search_paths ( & self ) -> Vec < PathBuf > {
125126 let mut p = PathBuf :: from ( self . sysroot ) ;
126- p. push ( & find_libdir ( self . sysroot ) ) ;
127+ p. push ( find_libdir ( self . sysroot ) . as_ref ( ) ) ;
127128 p. push ( RUST_LIB_DIR ) ;
128129 p. push ( & self . triple ) ;
129130 p. push ( "bin" ) ;
@@ -132,7 +133,7 @@ impl<'a> FileSearch<'a> {
132133}
133134
134135pub 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 ( ) ) ;
136137 assert ! ( p. is_relative( ) ) ;
137138 p. push ( RUST_LIB_DIR ) ;
138139 p. push ( target_triple) ;
@@ -166,7 +167,7 @@ pub fn get_or_default_sysroot() -> PathBuf {
166167}
167168
168169// 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 > {
170171 // FIXME: This is a quick hack to make the rustc binary able to locate
171172 // Rust libraries in Linux environments where libraries might be installed
172173 // 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