Skip to content

Rename collect_active_jobs to several distinct names#151976

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Zalathar:collect-active-jobs
Feb 3, 2026
Merged

Rename collect_active_jobs to several distinct names#151976
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Zalathar:collect-active-jobs

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Feb 2, 2026

Key renames:

  • Function collect_active_jobscollect_active_jobs_from_all_queries (method in trait QueryContext)
  • Constant COLLECT_ACTIVE_JOBSPER_QUERY_GATHER_ACTIVE_JOBS_FNS (list of per-query function pointers)
  • Function collect_active_jobsgather_active_jobs (per-query function in query_impl::$name)
  • Function collect_active_jobsgather_active_jobs_inner (method in QueryState)
    • Giving these four things distinct names makes it a lot easier to tell them apart!
    • The switch from “collect” (all queries) to “gather” (single query) is intended to make the different parts a bit more memorable and searchable; I couldn't think of a more natural way to express this distinction so I settled for two different synonyms.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)

@Zalathar Zalathar mentioned this pull request Feb 2, 2026
@Zalathar
Copy link
Member Author

Zalathar commented Feb 2, 2026

@rustbot blocked on #151978

@rustbot rustbot added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Feb 2, 2026
@Zalathar Zalathar added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) labels Feb 2, 2026
@rust-log-analyzer

This comment has been minimized.

@Zalathar Zalathar force-pushed the collect-active-jobs branch from 9fe0dee to 177809b Compare February 2, 2026 05:59
@Zalathar Zalathar changed the title Rename several parts of active-query-job collection (collect_active_jobs) Rename collect_active_jobs to several distinct names Feb 2, 2026
@Zalathar
Copy link
Member Author

Zalathar commented Feb 2, 2026

I decided to remove some of the other renames from this PR, and focus primarily on collect_active_jobs.

/// Internal per-query plumbing for collecting the set of active jobs for this query.
///
/// Should only be called through `PER_QUERY_GATHER_ACTIVE_JOBS_FNS`.
pub(crate) fn gather_active_jobs_outer<'tcx>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub(crate) fn gather_active_jobs_outer<'tcx>(
pub(crate) fn gather_active_jobs<'tcx>(

"Outer" seems like a bit of an overkill, given that gather_active_jobs_inner and this function already have different names.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, removing the _outer seems fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it was a close call between gather_active_jobs and gather_active_jobs_outer.

I slightly prefer _outer because the two parts are so distant, but I'm happy with both, so I'll go with reviewer preference and change it to gather_active_jobs.

@nnethercote
Copy link
Contributor

This is great! I have been annoyed by these names myself, thanks for fixing them. r=me with the _outer removed.

@Zalathar Zalathar force-pushed the collect-active-jobs branch from 177809b to dea5507 Compare February 3, 2026 00:19
@rustbot

This comment has been minimized.

@Zalathar Zalathar force-pushed the collect-active-jobs branch from dea5507 to f95f05f Compare February 3, 2026 00:21
@Zalathar
Copy link
Member Author

Zalathar commented Feb 3, 2026

Changed gather_active_jobs_outer to gather_active_jobs (per feedback), and also tweaked spacing/comments to more clearly indicate where the real work happens (diff).

@bors r=nnethercote

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 3, 2026

📋 This PR cannot be approved because it currently has the following label: S-blocked.

@Zalathar
Copy link
Member Author

Zalathar commented Feb 3, 2026

Oh yes, even the reduced version of this PR will still need a rebase for #151978.

@rust-bors

This comment has been minimized.

@Zalathar Zalathar force-pushed the collect-active-jobs branch from f95f05f to a0a5c41 Compare February 3, 2026 05:14
@rustbot

This comment has been minimized.

@Zalathar
Copy link
Member Author

Zalathar commented Feb 3, 2026

Rebased, but this will also need another rebase over #151975, which is currently in rollup.

@rust-bors

This comment has been minimized.

@Zalathar Zalathar force-pushed the collect-active-jobs branch from a0a5c41 to e58538c Compare February 3, 2026 09:12
@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Zalathar
Copy link
Member Author

Zalathar commented Feb 3, 2026

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Feb 3, 2026
@Zalathar
Copy link
Member Author

Zalathar commented Feb 3, 2026

@bors r=nnethercote

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 3, 2026

📌 Commit e58538c has been approved by nnethercote

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 Feb 3, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 3, 2026
…ethercote

Rename `collect_active_jobs` to several distinct names

Key renames:
- Function `collect_active_jobs` → `collect_active_jobs_from_all_queries` (method in trait `QueryContext`)
- Constant `COLLECT_ACTIVE_JOBS` → `PER_QUERY_GATHER_ACTIVE_JOBS_FNS` (list of per-query function pointers)
- Function `collect_active_jobs` → `gather_active_jobs` (per-query function in `query_impl::$name`)
- Function `collect_active_jobs` → `gather_active_jobs_inner` (method in `QueryState`)
  - Giving these four things distinct names makes it a lot easier to tell them apart!
  - The switch from “collect” (all queries) to “gather” (single query) is intended to make the different parts a bit more memorable and searchable; I couldn't think of a more natural way to express this distinction so I settled for two different synonyms.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
rust-bors bot pushed a commit that referenced this pull request Feb 3, 2026
Rollup of 6 pull requests

Successful merges:

 - #152008 (`rust-analyzer` subtree update)
 - #151109 (fN::BITS constants for feature float_bits_const)
 - #151976 (Rename `collect_active_jobs` to several distinct names)
 - #151691 (compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`)
 - #151919 (fix: Make `--color always` always print color with `--explain`)
 - #152028 (Convert to inline diagnostics in `rustc_driver_impl`)
rust-bors bot pushed a commit that referenced this pull request Feb 3, 2026
Rollup of 7 pull requests

Successful merges:

 - #152008 (`rust-analyzer` subtree update)
 - #151109 (fN::BITS constants for feature float_bits_const)
 - #151976 (Rename `collect_active_jobs` to several distinct names)
 - #151691 (compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`)
 - #151919 (fix: Make `--color always` always print color with `--explain`)
 - #152017 (Remove `with_no_trimmed_paths` use in query macro)
 - #152028 (Convert to inline diagnostics in `rustc_driver_impl`)
@rust-bors rust-bors bot merged commit f69082d into rust-lang:main Feb 3, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 3, 2026
rust-timer added a commit that referenced this pull request Feb 3, 2026
Rollup merge of #151976 - Zalathar:collect-active-jobs, r=nnethercote

Rename `collect_active_jobs` to several distinct names

Key renames:
- Function `collect_active_jobs` → `collect_active_jobs_from_all_queries` (method in trait `QueryContext`)
- Constant `COLLECT_ACTIVE_JOBS` → `PER_QUERY_GATHER_ACTIVE_JOBS_FNS` (list of per-query function pointers)
- Function `collect_active_jobs` → `gather_active_jobs` (per-query function in `query_impl::$name`)
- Function `collect_active_jobs` → `gather_active_jobs_inner` (method in `QueryState`)
  - Giving these four things distinct names makes it a lot easier to tell them apart!
  - The switch from “collect” (all queries) to “gather” (single query) is intended to make the different parts a bit more memorable and searchable; I couldn't think of a more natural way to express this distinction so I settled for two different synonyms.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Feb 3, 2026
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#152008 (`rust-analyzer` subtree update)
 - rust-lang/rust#151109 (fN::BITS constants for feature float_bits_const)
 - rust-lang/rust#151976 (Rename `collect_active_jobs` to several distinct names)
 - rust-lang/rust#151691 (compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`)
 - rust-lang/rust#151919 (fix: Make `--color always` always print color with `--explain`)
 - rust-lang/rust#152017 (Remove `with_no_trimmed_paths` use in query macro)
 - rust-lang/rust#152028 (Convert to inline diagnostics in `rustc_driver_impl`)
@Zalathar Zalathar deleted the collect-active-jobs branch February 3, 2026 22:20
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 4, 2026
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#152008 (`rust-analyzer` subtree update)
 - rust-lang/rust#151109 (fN::BITS constants for feature float_bits_const)
 - rust-lang/rust#151976 (Rename `collect_active_jobs` to several distinct names)
 - rust-lang/rust#151691 (compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`)
 - rust-lang/rust#151919 (fix: Make `--color always` always print color with `--explain`)
 - rust-lang/rust#152017 (Remove `with_no_trimmed_paths` use in query macro)
 - rust-lang/rust#152028 (Convert to inline diagnostics in `rustc_driver_impl`)
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Feb 5, 2026
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#152008 (`rust-analyzer` subtree update)
 - rust-lang/rust#151109 (fN::BITS constants for feature float_bits_const)
 - rust-lang/rust#151976 (Rename `collect_active_jobs` to several distinct names)
 - rust-lang/rust#151691 (compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`)
 - rust-lang/rust#151919 (fix: Make `--color always` always print color with `--explain`)
 - rust-lang/rust#152017 (Remove `with_no_trimmed_paths` use in query macro)
 - rust-lang/rust#152028 (Convert to inline diagnostics in `rustc_driver_impl`)
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.

5 participants