File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
compiler/rustc_metadata/src Expand file tree Collapse file tree 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> {
735735 } ;
736736 if file. starts_with ( "lib" ) {
737737 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+ }
739746 rlibs. insert ( loc_canon. clone ( ) , PathKind :: ExternFlag ) ;
740747 continue ;
741748 }
@@ -747,7 +754,13 @@ impl<'a> CrateLocator<'a> {
747754 let dll_prefix = self . target . dll_prefix . as_ref ( ) ;
748755 let dll_suffix = self . target . dll_suffix . as_ref ( ) ;
749756 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+ }
751764 dylibs. insert ( loc_canon. clone ( ) , PathKind :: ExternFlag ) ;
752765 continue ;
753766 }
You can’t perform that action at this time.
0 commit comments