From 0f334c3642257f711e0c397fec11707d86e14e70 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 6 Jan 2021 18:54:27 +0100 Subject: [PATCH] Check is_anon outside of can_reconstruct_query_key. --- compiler/rustc_middle/src/dep_graph/dep_node.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_middle/src/dep_graph/dep_node.rs b/compiler/rustc_middle/src/dep_graph/dep_node.rs index c4379670f9906..b775846bba452 100644 --- a/compiler/rustc_middle/src/dep_graph/dep_node.rs +++ b/compiler/rustc_middle/src/dep_graph/dep_node.rs @@ -230,7 +230,7 @@ pub mod dep_kind { is_anon: true, is_eval_always: false, - can_reconstruct_query_key: || false, + can_reconstruct_query_key: || true, force_from_dep_node: |_, _| false, try_load_from_on_disk_cache: |_, _| {}, }; @@ -257,7 +257,6 @@ pub mod dep_kind { #[inline(always)] fn can_reconstruct_query_key() -> bool { - !is_anon && as DepNodeParams>> ::can_reconstruct_query_key() } @@ -267,6 +266,10 @@ pub mod dep_kind { } fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: &DepNode) -> bool { + if is_anon { + return false; + } + if !can_reconstruct_query_key() { return false; } @@ -285,6 +288,10 @@ pub mod dep_kind { } fn try_load_from_on_disk_cache(tcx: TyCtxt<'_>, dep_node: &DepNode) { + if is_anon { + return + } + if !can_reconstruct_query_key() { return }