Remove QueryCtxt and trait HasDepContext#152704
Open
Zalathar wants to merge 3 commits intorust-lang:mainfrom
Open
Remove QueryCtxt and trait HasDepContext#152704Zalathar wants to merge 3 commits intorust-lang:mainfrom
QueryCtxt and trait HasDepContext#152704Zalathar wants to merge 3 commits intorust-lang:mainfrom
Conversation
This struct was only wrapping `TyCtxt` in order to implement traits that were removed by RUST-152636.
The need for a `HasDepContext` impl on tuples can be avoided by passing the query vtable as part of an argument tuple instead.
Zoxc
reviewed
Feb 16, 2026
| self.assert_dep_node_not_yet_allocated_in_current_session(tcx.sess, &dep_node, || { | ||
| format!( | ||
| "forcing query with already existing `DepNode`\n\ | ||
| - query-key: {task_arg:?}\n\ |
Contributor
There was a problem hiding this comment.
This won't just print the query key now.
Member
Author
There was a problem hiding this comment.
It will print a tuple of (query_name, key), which seems fine.
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.
rustc_query_system#152703 to reduce conflicts.With the
QueryContexttrait removed, wrapper structQueryCtxtno longer serves a purpose and can be replaced withTyCtxteverywhere.After that, the only obstacle to removing trait
HasDepContextisDepGraph::with_task, which uses the trait to allow passing both aTyCtxtand a query vtable through the context argument. But we can achieve the same result by passing the vtable through the other argument instead, in a tuple alongside the query key.r? nnethercote