Remove QueryCtxt and trait HasDepContext#152704
Remove QueryCtxt and trait HasDepContext#152704Zalathar wants to merge 3 commits intorust-lang:mainfrom
QueryCtxt and trait HasDepContext#152704Conversation
| 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\ |
There was a problem hiding this comment.
This won't just print the query key now.
There was a problem hiding this comment.
It will print a tuple of (query_name, key), which seems fine.
| // Delegate to another function to actually execute the query job. | ||
| let (result, dep_node_index) = if INCR { | ||
| execute_job_incr(query, qcx, qcx.tcx.dep_graph.data().unwrap(), key, dep_node, id) | ||
| execute_job_incr(query, tcx, tcx.dep_graph.data().unwrap(), key, dep_node, id) |
There was a problem hiding this comment.
We could now just pass in tcx and get the dep graph data later (in try_load_from_disk_and_cache_in_memory).
There was a problem hiding this comment.
That duplicates the unwrap(), so DepGraphData is passed around to indicate incremental is enabled.
| for SemiDynamicQueryDispatcher<'tcx, C, FLAGS> | ||
| { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| f.write_str(self.name()) |
There was a problem hiding this comment.
This omits most of the data in the type. Worth a brief comment explaining why?
|
r=me with the nits addressed, and merging should wait for #152703. |
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.
|
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. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
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