1
Fork 0

Do not require QueryCtxt for cache_on_disk.

This commit is contained in:
Camille GILLOT 2021-10-23 18:12:43 +02:00
parent 7c0920f5fb
commit 138e96b719
4 changed files with 5 additions and 6 deletions

View file

@ -1033,7 +1033,7 @@ where
if res.is_err() {
return;
}
if Q::cache_on_disk(tcx, &key) {
if Q::cache_on_disk(*tcx.dep_context(), &key) {
let dep_node = SerializedDepNodeIndex::new(dep_node.index());
// Record position of the cache entry.

View file

@ -315,7 +315,7 @@ macro_rules! define_queries {
} else {
tcx.queries.extern_providers.$name
};
let cache_on_disk = Self::cache_on_disk(tcx, key);
let cache_on_disk = Self::cache_on_disk(tcx.tcx, key);
QueryVtable {
anon: is_anon!([$($modifiers)*]),
eval_always: is_eval_always!([$($modifiers)*]),
@ -415,7 +415,6 @@ macro_rules! define_queries {
debug_assert!(tcx.dep_graph.is_green(&dep_node));
let key = recover(tcx, dep_node).unwrap_or_else(|| panic!("Failed to recover key for {:?} with hash {}", dep_node, dep_node.hash));
let tcx = QueryCtxt::from_tcx(tcx);
if queries::$name::cache_on_disk(tcx, &key) {
let _ = tcx.$name(key);
}