Skip to content

Commit 5ca2fea

Browse files
committed
Fix stdlib building
1 parent 77e580b commit 5ca2fea

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
@@ -580,11 +580,6 @@ impl<'a> CrateLocator<'a> {
580580
) {
581581
Ok(blob) => {
582582
if let Some(h) = self.crate_matches(&blob, &lib) {
583-
if blob.get_header().is_reference {
584-
if slot.is_none() {
585-
todo!("return error");
586-
}
587-
}
588583
(h, blob)
589584
} else {
590585
info!("metadata mismatch");
@@ -659,7 +654,12 @@ impl<'a> CrateLocator<'a> {
659654
continue;
660655
}
661656
}
662-
*slot = Some((hash, metadata, lib.clone()));
657+
658+
if !metadata.get_header().is_reference {
659+
// FIXME nicer error when only an rlib or dylib with is_reference is found
660+
// and no .rmeta?
661+
*slot = Some((hash, metadata, lib.clone()));
662+
}
663663
ret = Some((lib, kind));
664664
}
665665

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

0 commit comments

Comments
 (0)