@@ -575,11 +575,6 @@ impl<'a> CrateLocator<'a> {
575
575
) {
576
576
Ok ( blob) => {
577
577
if let Some ( h) = self . crate_matches ( & blob, & lib) {
578
- if blob. get_header ( ) . is_reference {
579
- if slot. is_none ( ) {
580
- todo ! ( "return error" ) ;
581
- }
582
- }
583
578
( h, blob)
584
579
} else {
585
580
info ! ( "metadata mismatch" ) ;
@@ -654,7 +649,12 @@ impl<'a> CrateLocator<'a> {
654
649
continue ;
655
650
}
656
651
}
657
- * slot = Some ( ( hash, metadata, lib. clone ( ) ) ) ;
652
+
653
+ if !metadata. get_header ( ) . is_reference {
654
+ // FIXME nicer error when only an rlib or dylib with is_reference is found
655
+ // and no .rmeta?
656
+ * slot = Some ( ( hash, metadata, lib. clone ( ) ) ) ;
657
+ }
658
658
ret = Some ( ( lib, kind) ) ;
659
659
}
660
660
@@ -744,10 +744,12 @@ impl<'a> CrateLocator<'a> {
744
744
let loc_canon = loc. canonicalized ( ) . clone ( ) ;
745
745
let loc = loc. original ( ) ;
746
746
if loc. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . ends_with ( ".rlib" ) {
747
+ rmetas. insert ( loc_canon. with_extension ( "rmeta" ) , PathKind :: ExternFlag ) ;
747
748
rlibs. insert ( loc_canon, PathKind :: ExternFlag ) ;
748
749
} else if loc. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . ends_with ( ".rmeta" ) {
749
750
rmetas. insert ( loc_canon, PathKind :: ExternFlag ) ;
750
751
} else {
752
+ rmetas. insert ( loc_canon. with_extension ( "rmeta" ) , PathKind :: ExternFlag ) ;
751
753
dylibs. insert ( loc_canon, PathKind :: ExternFlag ) ;
752
754
}
753
755
} else {
0 commit comments