diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2021-10-02 12:06:42 -0400 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2021-10-06 22:19:48 -0400 |
| commit | 6f78eed1c75bf6e42a2e7db125111bad155893b9 (patch) | |
| tree | d897639c3b0e2b0f4457ecee70aee327f6dd2810 /compiler/rustc_query_impl/src | |
| parent | 0eabf25b90396dead0b2a1aaa275af18a1ae6008 (diff) | |
Query the fingerprint style during key reconstruction
Keys can be reconstructed from fingerprints that are not DefPathHash, but then we cannot extract a DefId from them.
Diffstat (limited to 'compiler/rustc_query_impl/src')
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index b71a1722036..4d1e39db0ed 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -428,6 +428,7 @@ macro_rules! define_queries { use rustc_middle::ty::query::query_keys; use rustc_query_system::dep_graph::DepNodeParams; use rustc_query_system::query::{force_query, QueryDescription}; + use rustc_query_system::dep_graph::FingerprintStyle; // We use this for most things when incr. comp. is turned off. pub const Null: QueryStruct = QueryStruct { @@ -454,9 +455,9 @@ macro_rules! define_queries { const is_anon: bool = is_anon!([$($modifiers)*]); #[inline(always)] - fn can_reconstruct_query_key() -> bool { + fn fingerprint_style() -> FingerprintStyle { <query_keys::$name<'_> as DepNodeParams<TyCtxt<'_>>> - ::can_reconstruct_query_key() + ::fingerprint_style() } fn recover<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<query_keys::$name<'tcx>> { @@ -472,7 +473,7 @@ macro_rules! define_queries { return } - if !can_reconstruct_query_key() { + if !fingerprint_style().reconstructible() { return } |
