File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
compiler/rustc_metadata/src Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff 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
@@ -746,6 +746,7 @@ impl<'a> CrateLocator<'a> {
746746 let dll_prefix = self . target . dll_prefix . as_ref ( ) ;
747747 let dll_suffix = self . target . dll_suffix . as_ref ( ) ;
748748 if file. starts_with ( dll_prefix) && file. ends_with ( dll_suffix) {
749+ rmetas. insert ( loc_canon. with_extension ( "rmeta" ) , PathKind :: ExternFlag ) ;
749750 dylibs. insert ( loc_canon. clone ( ) , PathKind :: ExternFlag ) ;
750751 continue ;
751752 }
You can’t perform that action at this time.
0 commit comments