Do not require QueryCtxt for cache_on_disk.
This commit is contained in:
parent
7c0920f5fb
commit
138e96b719
@ -372,7 +372,7 @@ fn add_query_description_impl(
|
|||||||
quote! {
|
quote! {
|
||||||
#[allow(unused_variables, unused_braces)]
|
#[allow(unused_variables, unused_braces)]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cache_on_disk(#tcx: QueryCtxt<'tcx>, #key: &Self::Key) -> bool {
|
fn cache_on_disk(#tcx: TyCtxt<'tcx>, #key: &Self::Key) -> bool {
|
||||||
#expr
|
#expr
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ fn add_query_description_impl(
|
|||||||
}
|
}
|
||||||
quote! {
|
quote! {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cache_on_disk(_: QueryCtxt<'tcx>, _: &Self::Key) -> bool {
|
fn cache_on_disk(_: TyCtxt<'tcx>, _: &Self::Key) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1033,7 +1033,7 @@ where
|
|||||||
if res.is_err() {
|
if res.is_err() {
|
||||||
return;
|
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());
|
let dep_node = SerializedDepNodeIndex::new(dep_node.index());
|
||||||
|
|
||||||
// Record position of the cache entry.
|
// Record position of the cache entry.
|
||||||
|
@ -315,7 +315,7 @@ macro_rules! define_queries {
|
|||||||
} else {
|
} else {
|
||||||
tcx.queries.extern_providers.$name
|
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 {
|
QueryVtable {
|
||||||
anon: is_anon!([$($modifiers)*]),
|
anon: is_anon!([$($modifiers)*]),
|
||||||
eval_always: is_eval_always!([$($modifiers)*]),
|
eval_always: is_eval_always!([$($modifiers)*]),
|
||||||
@ -415,7 +415,6 @@ macro_rules! define_queries {
|
|||||||
debug_assert!(tcx.dep_graph.is_green(&dep_node));
|
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 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) {
|
if queries::$name::cache_on_disk(tcx, &key) {
|
||||||
let _ = tcx.$name(key);
|
let _ = tcx.$name(key);
|
||||||
}
|
}
|
||||||
|
@ -71,5 +71,5 @@ pub trait QueryDescription<CTX: QueryContext>: QueryConfig {
|
|||||||
// Don't use this method to compute query results, instead use the methods on TyCtxt
|
// Don't use this method to compute query results, instead use the methods on TyCtxt
|
||||||
fn make_vtable(tcx: CTX, key: &Self::Key) -> QueryVtable<CTX, Self::Key, Self::Value>;
|
fn make_vtable(tcx: CTX, key: &Self::Key) -> QueryVtable<CTX, Self::Key, Self::Value>;
|
||||||
|
|
||||||
fn cache_on_disk(tcx: CTX, key: &Self::Key) -> bool;
|
fn cache_on_disk(tcx: CTX::DepContext, key: &Self::Key) -> bool;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user