Skip to content

Remove some dep-graph assertions.#153814

Open
nnethercote wants to merge 1 commit intorust-lang:mainfrom
nnethercote:rm-dep-graph-assertions
Open

Remove some dep-graph assertions.#153814
nnethercote wants to merge 1 commit intorust-lang:mainfrom
nnethercote:rm-dep-graph-assertions

Conversation

@nnethercote
Copy link
Contributor

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.

r? @cjgillot

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.
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants