Move rustc_query_system::cache.#152199
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Feb 7, 2026
Merged
Conversation
Member
|
This looks like a chunk of code that would immediately make sense to extract as a submodule, so moving it inline into |
Zalathar
reviewed
Feb 6, 2026
rustc_query_system::cache.rustc_query_system::cache.
Because `Cache` is unhelpfully vague.
3852205 to
b49ab57
Compare
Contributor
Author
|
I have updated to preserve the |
Zalathar
reviewed
Feb 7, 2026
| use crate::dep_graph::{DepContext, DepNodeIndex}; | ||
|
|
||
| pub struct Cache<Key, Value> { | ||
| pub struct WithDepNodeCache<Key, Value> { |
Member
There was a problem hiding this comment.
Remark: This is a good example of my philosophy that an “inelegant” name is better than a name that is simple but confusing. 👍
Member
|
Thanks for the revisions; I find them very helpful. @bors r+ rollup |
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Feb 7, 2026
…cache, r=Zalathar Move `rustc_query_system::cache`. It only defines two types, `Cache` and `WithDepNode`. Neither has anything much to do with queries -- they use `DepNodeIndex`, that's all. This commit moves the module into `rustc_middle`, to where they are used. It also renames the extremely non-descriptive `Cache` as `WithDepNodeCache`. r? @Zalathar
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 7, 2026
…cache, r=Zalathar Move `rustc_query_system::cache`. It only defines two types, `Cache` and `WithDepNode`. Neither has anything much to do with queries -- they use `DepNodeIndex`, that's all. This commit moves the module into `rustc_middle`, to where they are used. It also renames the extremely non-descriptive `Cache` as `WithDepNodeCache`. r? @Zalathar
This was referenced Feb 7, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 7, 2026
…uwer Rollup of 8 pull requests Successful merges: - #148590 (Stabilize `atomic_try_update`and deprecate `fetch_update` starting 1.99.0) - #150522 (Stabilize new inclusive range type and iterator type) - #152235 (Convert to inline diagnostics in `rustc_parse`) - #152267 (feat: Implement `int_from_ascii` for `NonZero<T>`) - #151576 (Stabilize `core::hint::cold_path`) - #151933 (Linker-plugin-based LTO: give an explanation how to use linker-plugin-lto with full LTO) - #152010 (Ignore all debuginfo tests for LLDB that we do not run in CI) - #152199 (Move `rustc_query_system::cache`.)
rust-timer
added a commit
that referenced
this pull request
Feb 7, 2026
Rollup merge of #152199 - nnethercote:rm-rustc_query_system-cache, r=Zalathar Move `rustc_query_system::cache`. It only defines two types, `Cache` and `WithDepNode`. Neither has anything much to do with queries -- they use `DepNodeIndex`, that's all. This commit moves the module into `rustc_middle`, to where they are used. It also renames the extremely non-descriptive `Cache` as `WithDepNodeCache`. r? @Zalathar
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 12, 2026
…fei2009 Don't use `DepContext` in `rustc_middle::traits::cache` - A nice little simplification unlocked by rust-lang#152199. --- This code is now in `rustc_middle`, and doesn't need any non-trivial methods, so it can just use `TyCtxt` directly instead.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 12, 2026
…fei2009 Don't use `DepContext` in `rustc_middle::traits::cache` - A nice little simplification unlocked by rust-lang#152199. --- This code is now in `rustc_middle`, and doesn't need any non-trivial methods, so it can just use `TyCtxt` directly instead.
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Feb 13, 2026
…fei2009 Don't use `DepContext` in `rustc_middle::traits::cache` - A nice little simplification unlocked by rust-lang#152199. --- This code is now in `rustc_middle`, and doesn't need any non-trivial methods, so it can just use `TyCtxt` directly instead.
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Feb 13, 2026
…fei2009 Don't use `DepContext` in `rustc_middle::traits::cache` - A nice little simplification unlocked by rust-lang#152199. --- This code is now in `rustc_middle`, and doesn't need any non-trivial methods, so it can just use `TyCtxt` directly instead.
rust-timer
added a commit
that referenced
this pull request
Feb 13, 2026
Rollup merge of #152520 - Zalathar:traits-cache, r=dingxiangfei2009 Don't use `DepContext` in `rustc_middle::traits::cache` - A nice little simplification unlocked by #152199. --- This code is now in `rustc_middle`, and doesn't need any non-trivial methods, so it can just use `TyCtxt` directly instead.
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.
It only defines two types,
CacheandWithDepNode. Neither has anything much to do with queries -- they useDepNodeIndex, that's all.This commit moves the module into
rustc_middle, to where they are used. It also renames the extremely non-descriptiveCacheasWithDepNodeCache.r? @Zalathar