diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index 8148f8e017c..c87d26b3950 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -34,7 +34,6 @@ pub use rustc_query_system::query::{deadlock, QueryContext}; mod keys; use keys::Key; -use rustc_query_system::dep_graph::SerializedDepNodeIndex; pub use rustc_query_system::query::QueryConfig; pub(crate) use rustc_query_system::query::{QueryDescription, QueryVTable}; diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index e38de2a0e40..6e0649cc471 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -412,9 +412,6 @@ macro_rules! define_queries { impl<'tcx> QueryDescription> for queries::$name<'tcx> { rustc_query_description! { $name } - const TRY_LOAD_FROM_DISK: Option, SerializedDepNodeIndex) -> Option> - = should_ever_cache_on_disk!([$($modifiers)*]); - type Cache = query_storage::$name<'tcx>; #[inline(always)] @@ -445,7 +442,7 @@ macro_rules! define_queries { hash_result: hash_result!([$($modifiers)*]), handle_cycle_error: handle_cycle_error!([$($modifiers)*]), compute, - try_load_from_disk: if cache_on_disk { Self::TRY_LOAD_FROM_DISK } else { None }, + try_load_from_disk: if cache_on_disk { should_ever_cache_on_disk!([$($modifiers)*]) } else { None }, } } diff --git a/compiler/rustc_query_system/src/query/config.rs b/compiler/rustc_query_system/src/query/config.rs index 340deb88915..c4549cc9eb4 100644 --- a/compiler/rustc_query_system/src/query/config.rs +++ b/compiler/rustc_query_system/src/query/config.rs @@ -29,8 +29,7 @@ pub struct QueryVTable { pub compute: fn(CTX::DepContext, K) -> V, pub hash_result: Option, &V) -> Fingerprint>, pub handle_cycle_error: HandleCycleError, - // NOTE: this is not quite the same as `Q::TRY_LOAD_FROM_DISK`; it can also be `None` if - // `cache_on_disk` returned false for this key. + // NOTE: this is also `None` if `cache_on_disk()` returns false, not just if it's unsupported by the query pub try_load_from_disk: Option Option>, } @@ -48,8 +47,6 @@ impl QueryVTable { } pub trait QueryDescription: QueryConfig { - const TRY_LOAD_FROM_DISK: Option Option>; - type Cache: QueryCache; fn describe(tcx: CTX, key: Self::Key) -> String;