File tree 1 file changed +15
-2
lines changed
compiler/rustc_metadata/src
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -735,7 +735,14 @@ impl<'a> CrateLocator<'a> {
735
735
} ;
736
736
if file. starts_with ( "lib" ) {
737
737
if file. ends_with ( ".rlib" ) {
738
- rmetas. insert ( loc_canon. with_extension ( "rmeta" ) , PathKind :: ExternFlag ) ;
738
+ if let Ok ( rmeta_path) = try_canonicalize (
739
+ loc_orig
740
+ . parent ( )
741
+ . unwrap ( )
742
+ . join ( file. strip_suffix ( ".rlib" ) . unwrap ( ) . to_owned ( ) + ".rmeta" ) ,
743
+ ) {
744
+ rmetas. insert ( rmeta_path, PathKind :: ExternFlag ) ;
745
+ }
739
746
rlibs. insert ( loc_canon. clone ( ) , PathKind :: ExternFlag ) ;
740
747
continue ;
741
748
}
@@ -747,7 +754,13 @@ impl<'a> CrateLocator<'a> {
747
754
let dll_prefix = self . target . dll_prefix . as_ref ( ) ;
748
755
let dll_suffix = self . target . dll_suffix . as_ref ( ) ;
749
756
if file. starts_with ( dll_prefix) && file. ends_with ( dll_suffix) {
750
- rmetas. insert ( loc_canon. with_extension ( "rmeta" ) , PathKind :: ExternFlag ) ;
757
+ if let Ok ( rmeta_path) = try_canonicalize ( loc_orig. parent ( ) . unwrap ( ) . join (
758
+ "lib" . to_owned ( )
759
+ + file. strip_prefix ( dll_prefix) . unwrap ( ) . strip_suffix ( dll_suffix) . unwrap ( )
760
+ + ".rmeta" ,
761
+ ) ) {
762
+ rmetas. insert ( rmeta_path, PathKind :: ExternFlag ) ;
763
+ }
751
764
dylibs. insert ( loc_canon. clone ( ) , PathKind :: ExternFlag ) ;
752
765
continue ;
753
766
}
You can’t perform that action at this time.
0 commit comments