mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Remove QueryVTable::construct_dep_node.
It's just a wrapper for `DepNode::construct` and it only has three uses. Better to just have one way of doing things.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
use rustc_span::{ErrorGuaranteed, Span};
|
||||
pub use sealed::IntoQueryParam;
|
||||
|
||||
use crate::dep_graph::{DepKind, DepNode, DepNodeIndex, SerializedDepNodeIndex};
|
||||
use crate::dep_graph::{DepKind, DepNodeIndex, SerializedDepNodeIndex};
|
||||
use crate::ich::StableHashingContext;
|
||||
use crate::queries::{ExternProviders, Providers, QueryArenas, QueryVTables};
|
||||
use crate::query::on_disk_cache::OnDiskCache;
|
||||
@@ -180,12 +180,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, C: QueryCache> QueryVTable<'tcx, C> {
|
||||
pub fn construct_dep_node(&self, tcx: TyCtxt<'tcx>, key: &C::Key) -> DepNode {
|
||||
DepNode::construct(tcx, self.dep_kind, key)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct QuerySystem<'tcx> {
|
||||
pub arenas: WorkerLocal<QueryArenas<'tcx>>,
|
||||
pub query_vtables: QueryVTables<'tcx>,
|
||||
|
||||
@@ -453,7 +453,8 @@ fn execute_job_incr<'tcx, C: QueryCache>(
|
||||
|
||||
if !query.anon && !query.eval_always {
|
||||
// `to_dep_node` is expensive for some `DepKind`s.
|
||||
let dep_node = dep_node_opt.get_or_insert_with(|| query.construct_dep_node(tcx, &key));
|
||||
let dep_node =
|
||||
dep_node_opt.get_or_insert_with(|| DepNode::construct(tcx, query.dep_kind, &key));
|
||||
|
||||
// The diagnostics for this query will be promoted to the current session during
|
||||
// `try_mark_green()`, so we can ignore them here.
|
||||
@@ -485,7 +486,8 @@ fn execute_job_incr<'tcx, C: QueryCache>(
|
||||
}
|
||||
|
||||
// `to_dep_node` is expensive for some `DepKind`s.
|
||||
let dep_node = dep_node_opt.unwrap_or_else(|| query.construct_dep_node(tcx, &key));
|
||||
let dep_node =
|
||||
dep_node_opt.unwrap_or_else(|| DepNode::construct(tcx, query.dep_kind, &key));
|
||||
|
||||
// Call the query provider.
|
||||
dep_graph_data.with_task(
|
||||
@@ -629,7 +631,7 @@ fn check_if_ensure_can_skip_execution<'tcx, C: QueryCache>(
|
||||
// Ensuring an anonymous query makes no sense
|
||||
assert!(!query.anon);
|
||||
|
||||
let dep_node = query.construct_dep_node(tcx, key);
|
||||
let dep_node = DepNode::construct(tcx, query.dep_kind, key);
|
||||
|
||||
let dep_graph = &tcx.dep_graph;
|
||||
let serialized_dep_node_index = match dep_graph.try_mark_green(tcx, &dep_node) {
|
||||
|
||||
Reference in New Issue
Block a user