Skip to content

Commit 97eb465

Browse files
committed
Fix stdlib building
1 parent e43aa23 commit 97eb465

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

compiler/rustc_metadata/src/locator.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,6 @@ impl<'a> CrateLocator<'a> {
581581
) {
582582
Ok(blob) => {
583583
if let Some(h) = self.crate_matches(&blob, &lib) {
584-
if blob.get_header().is_reference {
585-
if slot.is_none() {
586-
todo!("return error");
587-
}
588-
}
589584
(h, blob)
590585
} else {
591586
info!("metadata mismatch");
@@ -660,7 +655,12 @@ impl<'a> CrateLocator<'a> {
660655
continue;
661656
}
662657
}
663-
*slot = Some((hash, metadata, lib.clone()));
658+
659+
if !metadata.get_header().is_reference {
660+
// FIXME nicer error when only an rlib or dylib with is_reference is found
661+
// and no .rmeta?
662+
*slot = Some((hash, metadata, lib.clone()));
663+
}
664664
ret = Some((lib, kind));
665665
}
666666

@@ -751,6 +751,7 @@ impl<'a> CrateLocator<'a> {
751751
let dll_prefix = self.target.dll_prefix.as_ref();
752752
let dll_suffix = self.target.dll_suffix.as_ref();
753753
if file.starts_with(dll_prefix) && file.ends_with(dll_suffix) {
754+
rmetas.insert(loc_canon.with_extension("rmeta"), PathKind::ExternFlag);
754755
return Some(dylibs);
755756
}
756757
None

0 commit comments

Comments
 (0)