1
Fork 0

Review comments

This commit is contained in:
bjorn3 2024-12-20 08:35:02 +00:00
parent 943f6a8ca9
commit 0daa921f0e
2 changed files with 9 additions and 3 deletions

View file

@ -234,8 +234,6 @@ pub fn each_linked_rlib(
crate_type: Option<CrateType>,
f: &mut dyn FnMut(CrateNum, &Path),
) -> Result<(), errors::LinkRlibError> {
let crates = info.used_crates.iter();
let fmts = if let Some(crate_type) = crate_type {
let Some(fmts) = info.dependency_formats.get(&crate_type) else {
return Err(errors::LinkRlibError::MissingFormat);
@ -261,7 +259,8 @@ pub fn each_linked_rlib(
info.dependency_formats.first().unwrap().1
};
for &cnum in crates {
let used_dep_crates = info.used_crates.iter();
for &cnum in used_dep_crates {
match fmts.get(cnum) {
Some(&Linkage::NotLinked | &Linkage::Dynamic | &Linkage::IncludedFromDylib) => continue,
Some(_) => {}