1
Fork 0

Make dependency_formats an FxIndexMap rather than a list of tuples

It is treated as a map already. This is using FxIndexMap rather than
UnordMap because the latter doesn't provide an api to pick a single
value iff all values are equal, which each_linked_rlib depends on.
This commit is contained in:
bjorn3 2024-12-12 14:44:18 +00:00
parent ea9e8c13dc
commit 3198496385
7 changed files with 21 additions and 37 deletions

View file

@ -287,12 +287,7 @@ fn dep_symbol_lookup_fn(
let mut dylib_paths = Vec::new();
let data = &crate_info
.dependency_formats
.iter()
.find(|(crate_type, _data)| *crate_type == rustc_session::config::CrateType::Executable)
.unwrap()
.1;
let data = &crate_info.dependency_formats[&rustc_session::config::CrateType::Executable].1;
// `used_crates` is in reverse postorder in terms of dependencies. Reverse the order here to
// get a postorder which ensures that all dependencies of a dylib are loaded before the dylib
// itself. This helps the dynamic linker to find dylibs not in the regular dynamic library