Skip to content

Various small query cleanups#153169

Merged
rust-bors[bot] merged 10 commits intorust-lang:mainfrom
nnethercote:rm-is_anon-etc
Mar 2, 2026
Merged

Various small query cleanups#153169
rust-bors[bot] merged 10 commits intorust-lang:mainfrom
nnethercote:rm-is_anon-etc

Conversation

@nnethercote
Copy link
Contributor

I found these while doing a close read of the query code.

r? @oli-obk

@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 27, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 27, 2026

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

}
}

impl<'tcx> FromCycleError<'tcx> for ty::SymbolName<'_> {
Copy link
Contributor

Choose a reason for hiding this comment

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

These impl are used with the default CycleErrorHandling::Error, so they don't need a query modifier to make use of them. We don't seem to have a test for the use case of this, so it's probably fine to remove anyway.

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

I rebased.

@bors r=petrochenkov

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 1, 2026

📌 Commit fa5138b has been approved by petrochenkov

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 1, 2026
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 1, 2026
…ochenkov

Various small query cleanups

I found these while doing a close read of the query code.

r? @oli-obk
@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 Mar 1, 2026
@rust-bors

This comment has been minimized.

This makes it clear the `CycleError` is not used after the call.
When there are two cases of equal size and importance, I find an if/else
expression easier to read than an early return.
It's an unnecessary level of indirection.
Calling `abort_if_errors` after emitting an error is guaranteed to call
`raise_fatal`, so just do that directly instead.
This exact comment block also appears in
`compiler/rustc_middle/src/queries.rs`, which is a better place for it.
`Value` is an unhelpfully generic name. Standard naming procedure for a
trait with a single method is for the trait name to match the method
name, which is what this commit does. Likewise, the enclosing module is
renamed from `values` to `from_cycle_error`.

Also add a comment about some non-obvious behaviour.
It has no effect.

`symbol_name` is the only query that produces a `SymbolName`. If it was
marked with `cycle_delayed_bug`/`cycle_stash` then this `FromCycleError`
impl would make sense, but that's not the case. Maybe it was the case in
the past.
@rustbot
Copy link
Collaborator

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

@bors r=petrochenkov

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 2, 2026

📌 Commit 5bd28b8 has been approved by petrochenkov

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 Mar 2, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 2, 2026
…ochenkov

Various small query cleanups

I found these while doing a close read of the query code.

r? @oli-obk
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
Rollup of 6 pull requests

Successful merges:

 - #153015 (core: make atomic primitives type aliases of `Atomic<T>`)
 - #153046 (Couple of cg_ssa refactorings)
 - #153169 (Various small query cleanups)
 - #152304 (stabilize new RangeToInclusive type)
 - #153225 (tests/ui/asm: add annotations for reference rules)
 - #153233 (test: add regression test for fuzzy_provenance_casts lint ICE)
jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 2, 2026
…ochenkov

Various small query cleanups

I found these while doing a close read of the query code.

r? @oli-obk
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #153169 (Various small query cleanups)
 - #152304 (stabilize new RangeToInclusive type)
 - #153046 (Couple of cg_ssa refactorings)
 - #153090 (elf-raw-dylib: set type for functions)
 - #153225 (tests/ui/asm: add annotations for reference rules)
 - #153233 (test: add regression test for fuzzy_provenance_casts lint ICE)
@rust-bors rust-bors bot merged commit af84b2a into rust-lang:main Mar 2, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 2, 2026
rust-timer added a commit that referenced this pull request Mar 2, 2026
Rollup merge of #153169 - nnethercote:rm-is_anon-etc, r=petrochenkov

Various small query cleanups

I found these while doing a close read of the query code.

r? @oli-obk
@nnethercote nnethercote deleted the rm-is_anon-etc branch March 2, 2026 21:16
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