Skip to content

Commit a67498d

Browse files
committed
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.
1 parent 657e8e2 commit a67498d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/helpers.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ pub fn iter_exported_symbols<'tcx>(
149149
let dependency_formats = tcx.dependency_formats(());
150150
// Find the dependencies of the executable we are running.
151151
let dependency_format = dependency_formats
152-
.iter()
153-
.find(|(crate_type, _)| *crate_type == CrateType::Executable)
152+
.get(&CrateType::Executable)
154153
.expect("interpreting a non-executable crate");
155-
for cnum in dependency_format.1.iter().enumerate().filter_map(|(num, &linkage)| {
154+
for cnum in dependency_format.iter().enumerate().filter_map(|(num, &linkage)| {
156155
// We add 1 to the number because that's what rustc also does everywhere it
157156
// calls `CrateNum::new`...
158157
#[expect(clippy::arithmetic_side_effects)]

0 commit comments

Comments
 (0)