about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-28 01:29:47 +0000
committerbors <bors@rust-lang.org>2021-01-28 01:29:47 +0000
commite32f372c4203b2527221b313cf63b05ea178e8a9 (patch)
treec5ba828f5758c455c3e466cb637463aa243aee23
parenta2f8f6281817d430e20726128b739d3c6708561c (diff)
parent36835b704f70e595032b058c1bc33fd7e2775d30 (diff)
downloadrust-e32f372c4203b2527221b313cf63b05ea178e8a9.tar.gz
rust-e32f372c4203b2527221b313cf63b05ea178e8a9.zip
Auto merge of #81414 - rylev:fetch-rmeta-crates, r=petrochenkov
Check for rmeta crates when getting existing crates from cache

This change makes sure to check for rmeta files when resolving crates instead of always going to disk in that case.
-rw-r--r--compiler/rustc_metadata/src/creader.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs
index a7bf79d7e67..f203094fc73 100644
--- a/compiler/rustc_metadata/src/creader.rs
+++ b/compiler/rustc_metadata/src/creader.rs
@@ -253,8 +253,9 @@ impl<'a> CrateLoader<'a> {
                 if let Some(mut files) = entry.files() {
                     if files.any(|l| {
                         let l = fs::canonicalize(l).unwrap_or(l.clone().into());
-                        source.dylib.as_ref().map(|p| &p.0) == Some(&l)
-                            || source.rlib.as_ref().map(|p| &p.0) == Some(&l)
+                        source.dylib.as_ref().map(|(p, _)| p) == Some(&l)
+                            || source.rlib.as_ref().map(|(p, _)| p) == Some(&l)
+                            || source.rmeta.as_ref().map(|(p, _)| p) == Some(&l)
                     }) {
                         ret = Some(cnum);
                     }