Skip to content

Commit f916f3a

Browse files
committed
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.
1 parent ad88831 commit f916f3a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

compiler/rustc_session/src/filesearch.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,7 @@ impl<'a> FileSearch<'a> {
4949
{
5050
for search_path in self.search_paths() {
5151
debug!("searching {}", search_path.dir.display());
52-
fn is_rlib(spf: &SearchPathFile) -> bool {
53-
if let Some(f) = &spf.file_name_str { f.ends_with(".rlib") } else { false }
54-
}
55-
// Reading metadata out of rlibs is faster, and if we find both
56-
// an rlib and a dylib we only read one of the files of
57-
// metadata, so in the name of speed, bring all rlib files to
58-
// the front of the search list.
59-
let files1 = search_path.files.iter().filter(|spf| is_rlib(&spf));
60-
let files2 = search_path.files.iter().filter(|spf| !is_rlib(&spf));
61-
for spf in files1.chain(files2) {
52+
for spf in search_path.files.iter() {
6253
debug!("testing {}", spf.path.display());
6354
let maybe_picked = pick(spf, search_path.kind);
6455
match maybe_picked {

0 commit comments

Comments
 (0)