about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-02-01 16:18:39 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-02-02 09:06:34 +1100
commitf916f3a36b21629d58e1b8ea4dbddc0db1316903 (patch)
treef2b0f3e914ab05e880ec68b1886f6b99ba9efbc9
parentad88831cd50ffe9cb9006bbdcb7fc9d97142e410 (diff)
downloadrust-f916f3a36b21629d58e1b8ea4dbddc0db1316903.tar.gz
rust-f916f3a36b21629d58e1b8ea4dbddc0db1316903.zip
Remove rlib special-casing in `FileSearch::search`.
This code and comment appear to be out of date.
`CrateLocator::find_library_crate` is the only caller of this function
and it handles rlib vs dylib overlap itself (see
`CrateLocator::extract_lib`) after inspecting all the files present, so
it doesn't need to see them in any particular order.
-rw-r--r--compiler/rustc_session/src/filesearch.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs
index 357190178ce..9687d0bd8a7 100644
--- a/compiler/rustc_session/src/filesearch.rs
+++ b/compiler/rustc_session/src/filesearch.rs
@@ -49,16 +49,7 @@ impl<'a> FileSearch<'a> {
     {
         for search_path in self.search_paths() {
             debug!("searching {}", search_path.dir.display());
-            fn is_rlib(spf: &SearchPathFile) -> bool {
-                if let Some(f) = &spf.file_name_str { f.ends_with(".rlib") } else { false }
-            }
-            // Reading metadata out of rlibs is faster, and if we find both
-            // an rlib and a dylib we only read one of the files of
-            // metadata, so in the name of speed, bring all rlib files to
-            // the front of the search list.
-            let files1 = search_path.files.iter().filter(|spf| is_rlib(&spf));
-            let files2 = search_path.files.iter().filter(|spf| !is_rlib(&spf));
-            for spf in files1.chain(files2) {
+            for spf in search_path.files.iter() {
                 debug!("testing {}", spf.path.display());
                 let maybe_picked = pick(spf, search_path.kind);
                 match maybe_picked {