Skip to content

Rename all-query functions.#153940

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
nnethercote:rename-all-query-fns
Mar 16, 2026
Merged

Rename all-query functions.#153940
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
nnethercote:rename-all-query-fns

Conversation

@nnethercote
Copy link
Contributor

There are four functions that use for_each_query_vtable! to call an "inner" function. They are:

  • collect_active_jobs_from_all_queries -> gather_active_jobs
  • alloc_self_profile_query_strings -> alloc_self_profile_query_strings_for_query_cache
  • encode_all_query_results -> encode_query_results
  • query_key_hash_verify_all -> query_key_hash_verify

These names are all over the place. This commit renames them as follows:

  • collect_active_query_jobs{,_inner}
  • alloc_self_profile_query_strings{,_inner}
  • encode_query_values{,_inner}
  • verify_query_key_hashes{,_inner}

This:

  • puts the verb at the start
  • uses _inner for all the inners (which makes sense now that the inners are all next to their callers)
  • uses _query_ consistently
  • avoids all, because the plurals are enough
  • uses values instead of results
  • removes the collect/gather distinction, which is no longer important

r? @Zalathar

@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2026

Zalathar is not on the review rotation at the moment.
They may take a while to respond.

@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 16, 2026
There are four functions that use `for_each_query_vtable!` to call an "inner"
function. They are:

- collect_active_jobs_from_all_queries -> gather_active_jobs
- alloc_self_profile_query_strings -> alloc_self_profile_query_strings_for_query_cache
- encode_all_query_results -> encode_query_results
- query_key_hash_verify_all -> query_key_hash_verify

These names are all over the place. This commit renames them as follows:

- collect_active_query_jobs{,_inner}
- alloc_self_profile_query_strings{,_inner}
- encode_query_values{,_inner}
- verify_query_key_hashes{,_inner}

This:
- puts the verb at the start
- uses "inner" for all the inners (which makes sense now that the inners are
  all next to their callers)
- uses `_query_` consistently
- avoids `all`, because the plurals are enough
- uses `values` instead of `results`
- removes the `collect`/`gather` distinction, which is no longer
  important
It should have been removed in rust-lang#153650. (The comments on
`CollectActiveJobsKind` suffice now.)
@nnethercote nnethercote force-pushed the rename-all-query-fns branch from d2eacf6 to a8024fc Compare March 16, 2026 05:36
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2026

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@nnethercote
Copy link
Contributor Author

I updated to address the comments. I also added a second commit removing an out-of-date comment.

@Zalathar
Copy link
Member

Looks good, r=me when PR CI is green.

@Zalathar
Copy link
Member

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 16, 2026

📌 Commit a8024fc has been approved by Zalathar

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 16, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 16, 2026

⌛ Testing commit a8024fc with merge 45263da...

Workflow: https://github.com/rust-lang/rust/actions/runs/23132264375

rust-bors bot pushed a commit that referenced this pull request Mar 16, 2026
Rename all-query functions.

There are four functions that use `for_each_query_vtable!` to call an "inner" function. They are:

- `collect_active_jobs_from_all_queries` -> `gather_active_jobs`
- `alloc_self_profile_query_strings` -> `alloc_self_profile_query_strings_for_query_cache`
- `encode_all_query_results` -> `encode_query_results`
- `query_key_hash_verify_all` -> `query_key_hash_verify`

These names are all over the place. This commit renames them as follows:

- `collect_active_query_jobs{,_inner}`
- `alloc_self_profile_query_strings{,_inner}`
- `encode_query_values{,_inner}`
- `verify_query_key_hashes{,_inner}`

This:
- puts the verb at the start
- uses `_inner` for all the inners (which makes sense now that the inners are all next to their callers)
- uses `_query_` consistently
- avoids `all`, because the plurals are enough
- uses `values` instead of `results`
- removes the `collect`/`gather` distinction, which is no longer important

r? @Zalathar
@Zalathar
Copy link
Member

@bors yield (enclosing rollup)

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 16, 2026

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #153944.

rust-bors bot pushed a commit that referenced this pull request Mar 16, 2026
Rollup of 2 pull requests

Successful merges:

 - #153940 (Rename all-query functions.)
 - #153942 (Re-export `rustc_middle::query::{QuerySystem, QueryVTable}`)
@rust-bors rust-bors bot merged commit ebd6268 into rust-lang:main Mar 16, 2026
11 of 12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 16, 2026
@nnethercote nnethercote deleted the rename-all-query-fns branch March 16, 2026 10:36
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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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