Skip to content

Commit 1e4b453

Browse files
committed
Remove some dep-graph assertions.
The call chain for a non-incremental query includes the following functions: - execute_query_non_incr_inner (assert!) - try_execute_query (assert!) - execute_job_non_incr (assert!) And likewise for an incremental query: - execute_query_incr_inner (assert!) - try_execute_query (assert!) - execute_job_incr (expect) That is five distinct functions. Every one of them has an `assert!` or `expect` call that checks that the dep-graph is/is not enabled as expected. Three cheers for defensive programming but this feels like overkill, particularly when `execute_job{,_non_incr,_incr}` each have a single call site. This commit removes the assertions in `execute_query_*` and `try_execute_query`, leaving a check in each of the `execute_job_*` functions.
1 parent eb9d3ca commit 1e4b453

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

compiler/rustc_query_impl/src/execution.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,6 @@ fn try_execute_query<'tcx, C: QueryCache, const INCR: bool>(
298298
// panic occurs while executing the query (or any intermediate plumbing).
299299
let job_guard = ActiveJobGuard { state: &query.state, key, key_hash };
300300

301-
debug_assert_eq!(tcx.dep_graph.is_fully_enabled(), INCR);
302-
303301
// Delegate to another function to actually execute the query job.
304302
let (value, dep_node_index) = if INCR {
305303
execute_job_incr(query, tcx, key, dep_node, id)
@@ -618,8 +616,6 @@ pub(super) fn execute_query_non_incr_inner<'tcx, C: QueryCache>(
618616
span: Span,
619617
key: C::Key,
620618
) -> C::Value {
621-
debug_assert!(!tcx.dep_graph.is_fully_enabled());
622-
623619
ensure_sufficient_stack(|| try_execute_query::<C, false>(query, tcx, span, key, None).0)
624620
}
625621

@@ -633,8 +629,6 @@ pub(super) fn execute_query_incr_inner<'tcx, C: QueryCache>(
633629
key: C::Key,
634630
mode: QueryMode,
635631
) -> Option<C::Value> {
636-
debug_assert!(tcx.dep_graph.is_fully_enabled());
637-
638632
// Check if query execution can be skipped, for `ensure_ok` or `ensure_done`.
639633
// This might have the side-effect of creating a suitable DepNode, which
640634
// we should reuse for execution instead of creating a new one.

0 commit comments

Comments
 (0)