Skip to content

Commit f02f239

Browse files
committed
Fix stdlib building
1 parent e1be9ca commit f02f239

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

compiler/rustc_metadata/src/locator.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -577,11 +577,6 @@ impl<'a> CrateLocator<'a> {
577577
) {
578578
Ok(blob) => {
579579
if let Some(h) = self.crate_matches(&blob, &lib) {
580-
if blob.get_header().is_reference {
581-
if slot.is_none() {
582-
todo!("return error");
583-
}
584-
}
585580
(h, blob)
586581
} else {
587582
info!("metadata mismatch");
@@ -656,7 +651,12 @@ impl<'a> CrateLocator<'a> {
656651
continue;
657652
}
658653
}
654+
655+
if !metadata.get_header().is_reference {
656+
// FIXME nicer error when only an rlib or dylib with is_reference is found
657+
// and no .rmeta?
659658
*slot = Some((hash, metadata, lib.clone()));
659+
}
660660
ret = Some((lib, kind));
661661
}
662662

@@ -747,6 +747,7 @@ impl<'a> CrateLocator<'a> {
747747
let dll_prefix = self.target.dll_prefix.as_ref();
748748
let dll_suffix = self.target.dll_suffix.as_ref();
749749
if file.starts_with(dll_prefix) && file.ends_with(dll_suffix) {
750+
rmetas.insert(loc_canon.with_extension("rmeta"), PathKind::ExternFlag);
750751
return Some(dylibs);
751752
}
752753
None

0 commit comments

Comments
 (0)