Skip to content

Commit

Permalink
Auto merge of #81414 - rylev:fetch-rmeta-crates, r=petrochenkov
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jan 28, 2021
2 parents a2f8f62 + 36835b7 commit e32f372
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e32f372

Please sign in to comment.