Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Feb 9, 2026

JobOwner appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by execute_job to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to complete, and avoids having to recompute the hash in drop.

r? nnethercote (or compiler)

@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 Feb 9, 2026
@nnethercote
Copy link
Contributor

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

📌 Commit d2dbd38 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 9, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 9, 2026
…ercote

Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

r? nnethercote (or compiler)
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

⌛ Testing commit d2dbd38 with merge 0e3b79b...

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

rust-bors bot pushed a commit that referenced this pull request Feb 9, 2026
Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

r? nnethercote (or compiler)
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 9, 2026
…ercote

Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

r? nnethercote (or compiler)
@Zalathar
Copy link
Member Author

Zalathar commented Feb 9, 2026

@bors r- (yield to conflicting #152371)

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 9, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

Commit d2dbd38 has been unapproved.

Auto build cancelled due to unapproval. Cancelled workflows:

This commit also adds and updates some relevant comments.
This value is a previously-computed hash of the key, so it makes sense to
bundle it with the key inside the guard, since the guard will need it on
completion anyway.
@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 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 9, 2026

Rebased over trivial conflict.

@bors r=nnethercote

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

📌 Commit c475bda 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 9, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 9, 2026
…ercote

Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

r? nnethercote (or compiler)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 9, 2026
…ercote

Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

r? nnethercote (or compiler)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 9, 2026
…ercote

Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

r? nnethercote (or compiler)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 9, 2026
…ercote

Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

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

Successful merges:

 - #152388 (`rust-analyzer` subtree update)
 - #151613 (Align `ArrayWindows` trait impls with `Windows`)
 - #152134 (Set crt_static_allow_dylibs to true for Emscripten target)
 - #152166 (cleanup some more things in `proc_macro::bridge`)
 - #152236 (compiletest: `-Zunstable-options` for json targets)
 - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented)
 - #142957 (std: introduce path normalize methods at top of `std::path`)
 - #145504 (Add some conversion trait impls)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
 - #152315 (fix: rhs_span to rhs_span_new)
 - #152327 (Check stalled coroutine obligations eagerly)
 - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
rust-bors bot pushed a commit that referenced this pull request Feb 9, 2026
Rollup of 12 pull requests

Successful merges:

 - #152388 (`rust-analyzer` subtree update)
 - #151613 (Align `ArrayWindows` trait impls with `Windows`)
 - #152134 (Set crt_static_allow_dylibs to true for Emscripten target)
 - #152166 (cleanup some more things in `proc_macro::bridge`)
 - #152236 (compiletest: `-Zunstable-options` for json targets)
 - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented)
 - #142957 (std: introduce path normalize methods at top of `std::path`)
 - #145504 (Add some conversion trait impls)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
 - #152315 (fix: rhs_span to rhs_span_new)
 - #152327 (Check stalled coroutine obligations eagerly)
 - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
rust-bors bot pushed a commit that referenced this pull request Feb 9, 2026
Rollup of 12 pull requests

Successful merges:

 - #152388 (`rust-analyzer` subtree update)
 - #151613 (Align `ArrayWindows` trait impls with `Windows`)
 - #152134 (Set crt_static_allow_dylibs to true for Emscripten target)
 - #152166 (cleanup some more things in `proc_macro::bridge`)
 - #152236 (compiletest: `-Zunstable-options` for json targets)
 - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented)
 - #142957 (std: introduce path normalize methods at top of `std::path`)
 - #145504 (Add some conversion trait impls)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
 - #152315 (fix: rhs_span to rhs_span_new)
 - #152327 (Check stalled coroutine obligations eagerly)
 - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
@rust-bors rust-bors bot merged commit 2f16df1 into rust-lang:main Feb 9, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Feb 9, 2026
Rollup merge of #152377 - Zalathar:active-job-guard, r=nnethercote

Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`

`JobOwner` appears to have had more responsibilities in the past, but nowadays it's just a stack-guard object used by `execute_job` to poison the query state for the current key if some inner part of query execution panics.

The new name and comments should hopefully be clearer about its (limited) role.

I have also included a follow-up change that stores both the key and its previously-computed hash in the guard, instead of just the key. This avoids having to pass the key to `complete`, and avoids having to recompute the hash in `drop`.

r? nnethercote (or compiler)
@rustbot rustbot added this to the 1.95.0 milestone Feb 9, 2026
@Zalathar Zalathar deleted the active-job-guard branch February 9, 2026 22:57
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