Various small query cleanups#153169
Merged
rust-bors[bot] merged 10 commits intorust-lang:mainfrom Mar 2, 2026
Merged
Conversation
Collaborator
|
|
petrochenkov
approved these changes
Feb 27, 2026
Zoxc
reviewed
Feb 27, 2026
| } | ||
| } | ||
|
|
||
| impl<'tcx> FromCycleError<'tcx> for ty::SymbolName<'_> { |
Contributor
There was a problem hiding this comment.
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.
This comment has been minimized.
This comment has been minimized.
2ac9c20 to
fa5138b
Compare
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
I rebased. @bors r=petrochenkov |
Contributor
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
This comment has been minimized.
This comment has been minimized.
It's unused.
It has a single use.
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 reads better that way.
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.
fa5138b to
5bd28b8
Compare
Collaborator
|
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. |
Contributor
Author
|
I rebased again. @bors r=petrochenkov |
Contributor
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found these while doing a close read of the query code.
r? @oli-obk