Skip to content

Remove QueryInfo.#153639

Open
nnethercote wants to merge 2 commits intorust-lang:mainfrom
nnethercote:rm-QueryInfo
Open

Remove QueryInfo.#153639
nnethercote wants to merge 2 commits intorust-lang:mainfrom
nnethercote:rm-QueryInfo

Conversation

@nnethercote
Copy link
Contributor

CycleError has one field containing a (Span, QueryStackFrame<I>) and another field containing a QueryInfo, which is a struct containing just a Span and a QueryStackFrame<I>.

We already have the Spanned type for adding a span to something. This commit uses it for both fields in CycleError, removing the need for QueryInfo. Which is good for the following reasons.

  • Any type with Info in the name is suspect, IMO.
  • QueryInfo can no longer be confused with the similar QueryJobInfo.
  • The doc comment on QueryInfo was wrong; it didn't contain a query key.

r? @Mark-Simulacrum

@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 10, 2026
@nnethercote
Copy link
Contributor Author

This should wait for #153493, to avoid causing conflicts.

cc @zetanumbers @Zoxc

@nnethercote nnethercote added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Mar 10, 2026
@zetanumbers
Copy link
Contributor

This is a good refactor.

@nnethercote nnethercote force-pushed the rm-QueryInfo branch 2 times, most recently from 75f763d to 0c04bfe Compare March 11, 2026 03:33
@rustbot

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

I added a tiny commit to remove Clone from CycleError.

@rust-bors

This comment has been minimized.

`CycleError` has one field containing a `(Span, QueryStackFrame<I>)` and
another field containing a `QueryInfo`, which is a struct containing
just a `Span` and a `QueryStackFrame<I>`.

We already have the `Spanned` type for adding a span to something. This
commit uses it for both fields in `CycleError`, removing the need for
`QueryInfo`. Which is good for the following reasons.
- Any type with `Info` in the name is suspect, IMO.
- `QueryInfo` can no longer be confused with the similar `QueryJobInfo`.
- The doc comment on `QueryInfo` was wrong; it didn't contain a query
  key.
@rustbot
Copy link
Collaborator

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

@nnethercote
Copy link
Contributor Author

I rebased.

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-blocked Status: Blocked on something else such as an RFC or other implementation work. 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.

5 participants