Skip to content

Move query-stack-frame spans into QueryStackFrame#153998

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Zalathar:stack-frame
Mar 18, 2026
Merged

Move query-stack-frame spans into QueryStackFrame#153998
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Zalathar:stack-frame

Conversation

@Zalathar
Copy link
Member


Code that previously used QueryStackFrame now uses TaggedQueryKey directly.

Code that previously used Spanned<QueryStackFrame> now uses QueryStackFrame, which includes a span.

This ends up bringing QueryStackFrame closer to the expectations of the code that actually consumes query cycles, and also avoids the awkward and misleading respan calls and node field accesses that had been required by Spanned.

r? nnethercote

@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 17, 2026
@rust-bors

This comment has been minimized.

Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

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

Looks good. r=me after addressing the one comment below.

View changes since this review

///
/// This is mostly used in case of cycles for error reporting.
#[derive(Clone, Debug)]
pub struct QueryStackFrame<'tcx> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the Clone derive be removed, or a Copy derive be added?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like it can just be removed.

Code that previously used `QueryStackFrame` now uses `TaggedQueryKey` directly.

Code that previously used `Spanned<QueryStackFrame>` now uses
`QueryStackFrame`, which includes a span.
@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 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

Rebased and removed the Clone derive.

@bors r=nnethercote

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 17, 2026

📌 Commit fbd3b6d 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 Mar 17, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 18, 2026
Move query-stack-frame spans into `QueryStackFrame`

- Follow-up to rust-lang#153907 (comment).
---

Code that previously used `QueryStackFrame` now uses `TaggedQueryKey` directly.

Code that previously used `Spanned<QueryStackFrame>` now uses `QueryStackFrame`, which includes a span.

This ends up bringing QueryStackFrame closer to the expectations of the code that actually consumes query cycles, and also avoids the awkward and misleading `respan` calls and `node` field accesses that had been required by `Spanned`.

r? nnethercote
rust-bors bot pushed a commit that referenced this pull request Mar 18, 2026
Rollup of 3 pull requests

Successful merges:

 - #153727 (When single impl can satisfy inference error, suggest type)
 - #153998 (Move query-stack-frame spans into `QueryStackFrame`)
 - #154026 (Remove unused types `UnusedGenericParams` and `FiniteBitSet`)
rust-bors bot pushed a commit that referenced this pull request Mar 18, 2026
Rollup of 3 pull requests

Successful merges:

 - #153998 (Move query-stack-frame spans into `QueryStackFrame`)
 - #153778 (Couple of driver interface improvements)
 - #154026 (Remove unused types `UnusedGenericParams` and `FiniteBitSet`)
@rust-bors rust-bors bot merged commit f2d25df into rust-lang:main Mar 18, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 18, 2026
@Zalathar Zalathar deleted the stack-frame branch March 18, 2026 07:38
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