Only create OnDiskCache
in incremental compilation mode
This lets us skip doing useless work when we're not in incremental compilation mode.
This commit is contained in:
parent
fe982319aa
commit
d00ed01876
6 changed files with 33 additions and 17 deletions
|
@ -130,8 +130,8 @@ rustc_queries! {
|
|||
storage(ArenaCacheSelector<'tcx>)
|
||||
cache_on_disk_if { key.is_local() }
|
||||
load_cached(tcx, id) {
|
||||
let generics: Option<ty::Generics> = tcx.queries.on_disk_cache
|
||||
.try_load_query_result(tcx, id);
|
||||
let generics: Option<ty::Generics> = tcx.queries.on_disk_cache.as_ref()
|
||||
.and_then(|c| c.try_load_query_result(tcx, id));
|
||||
generics
|
||||
}
|
||||
}
|
||||
|
@ -688,8 +688,8 @@ rustc_queries! {
|
|||
cache_on_disk_if { true }
|
||||
load_cached(tcx, id) {
|
||||
let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
|
||||
.queries.on_disk_cache
|
||||
.try_load_query_result(tcx, id);
|
||||
.queries.on_disk_cache.as_ref()
|
||||
.and_then(|c| c.try_load_query_result(tcx, id));
|
||||
|
||||
typeck_results.map(|x| &*tcx.arena.alloc(x))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue