@@ -576,11 +576,6 @@ impl<'a> CrateLocator<'a> {
576576 ) {
577577 Ok ( blob) => {
578578 if let Some ( h) = self . crate_matches ( & blob, & lib) {
579- if blob. get_header ( ) . is_reference {
580- if slot. is_none ( ) {
581- todo ! ( "return error" ) ;
582- }
583- }
584579 ( h, blob)
585580 } else {
586581 info ! ( "metadata mismatch" ) ;
@@ -629,7 +624,11 @@ impl<'a> CrateLocator<'a> {
629624 continue ;
630625 }
631626
632- * slot = Some ( ( hash, metadata, lib. clone ( ) ) ) ;
627+ if !metadata. get_header ( ) . is_reference {
628+ // FIXME nicer error when only an rlib or dylib with is_reference is found
629+ // and no .rmeta?
630+ * slot = Some ( ( hash, metadata, lib. clone ( ) ) ) ;
631+ }
633632 ret = Some ( ( lib, kind) ) ;
634633 }
635634
@@ -719,10 +718,12 @@ impl<'a> CrateLocator<'a> {
719718 let loc_canon = loc. canonicalized ( ) . clone ( ) ;
720719 let loc = loc. original ( ) ;
721720 if loc. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . ends_with ( ".rlib" ) {
721+ rmetas. insert ( loc_canon. with_extension ( "rmeta" ) , PathKind :: ExternFlag ) ;
722722 rlibs. insert ( loc_canon, PathKind :: ExternFlag ) ;
723723 } else if loc. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . ends_with ( ".rmeta" ) {
724724 rmetas. insert ( loc_canon, PathKind :: ExternFlag ) ;
725725 } else {
726+ rmetas. insert ( loc_canon. with_extension ( "rmeta" ) , PathKind :: ExternFlag ) ;
726727 dylibs. insert ( loc_canon, PathKind :: ExternFlag ) ;
727728 }
728729 } else {
0 commit comments