about summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-05-29 22:38:51 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-05-29 22:38:51 +0200
commitf3ed997254aad0354d79d79497ced1357999bfae (patch)
tree301381ab2566c671b963d1633dc7d77608513700 /compiler/rustc_query_system
parentc95a5682f76ab5e5b1be93237cc5b381ba5bb50c (diff)
Move reconstruct test inwards.
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/query/plumbing.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs
index c6a6b5ba88f..c1f9fa39e98 100644
--- a/compiler/rustc_query_system/src/query/plumbing.rs
+++ b/compiler/rustc_query_system/src/query/plumbing.rs
@@ -753,7 +753,10 @@ where
     CTX: QueryContext,
 {
     debug_assert!(!query.anon);
-    debug_assert!(<C::Key as DepNodeParams<CTX::DepContext>>::can_reconstruct_query_key());
+
+    if !<C::Key as DepNodeParams<CTX::DepContext>>::can_reconstruct_query_key() {
+        return false;
+    }
 
     let key = if let Some(key) =
         <C::Key as DepNodeParams<CTX::DepContext>>::recover(*tcx.dep_context(), &dep_node)
@@ -840,9 +843,5 @@ where
         return false;
     }
 
-    if !<Q::Key as DepNodeParams<CTX::DepContext>>::can_reconstruct_query_key() {
-        return false;
-    }
-
     force_query_impl(tcx, Q::query_state(tcx), Q::query_cache(tcx), *dep_node, &Q::VTABLE)
 }