Skip to content

Commit dba40d8

Browse files
authored
Rollup merge of rust-lang#65162 - Mark-Simulacrum:no-cache-loading-map, r=michaelwoerister
Remove loaded_from_cache map from DepGraph It's now unused, even with -Zquery-dep-graph From https://github.com/rust-lang/rust/pull/63756/files#r316039379 -- it'll simplify that PR to get this landed separately so we can just remove some of the code that it touches. r? @Zoxc or @michaelwoerister
2 parents 6f88087 + 4c32d47 commit dba40d8

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/librustc/dep_graph/graph.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ struct DepGraphData {
7474
previous_work_products: FxHashMap<WorkProductId, WorkProduct>,
7575

7676
dep_node_debug: Lock<FxHashMap<DepNode, String>>,
77-
78-
// Used for testing, only populated when -Zquery-dep-graph is specified.
79-
loaded_from_cache: Lock<FxHashMap<DepNodeIndex, bool>>,
8077
}
8178

8279
pub fn hash_result<R>(hcx: &mut StableHashingContext<'_>, result: &R) -> Option<Fingerprint>
@@ -103,7 +100,6 @@ impl DepGraph {
103100
emitting_diagnostics_cond_var: Condvar::new(),
104101
previous: prev_graph,
105102
colors: DepNodeColorMap::new(prev_graph_node_count),
106-
loaded_from_cache: Default::default(),
107103
})),
108104
}
109105
}
@@ -865,25 +861,6 @@ impl DepGraph {
865861
}
866862
}
867863
}
868-
869-
pub fn mark_loaded_from_cache(&self, dep_node_index: DepNodeIndex, state: bool) {
870-
debug!("mark_loaded_from_cache({:?}, {})",
871-
self.data.as_ref().unwrap().current.borrow().data[dep_node_index].node,
872-
state);
873-
874-
self.data
875-
.as_ref()
876-
.unwrap()
877-
.loaded_from_cache
878-
.borrow_mut()
879-
.insert(dep_node_index, state);
880-
}
881-
882-
pub fn was_loaded_from_cache(&self, dep_node: &DepNode) -> Option<bool> {
883-
let data = self.data.as_ref().unwrap();
884-
let dep_node_index = data.current.borrow().node_to_node_index[dep_node];
885-
data.loaded_from_cache.borrow().get(&dep_node_index).cloned()
886-
}
887864
}
888865

889866
/// A "work product" is an intermediate result that we save into the

src/librustc/ty/query/plumbing.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,6 @@ impl<'tcx> TyCtxt<'tcx> {
449449
self.incremental_verify_ich::<Q>(&result, dep_node, dep_node_index);
450450
}
451451

452-
if unlikely!(self.sess.opts.debugging_opts.query_dep_graph) {
453-
self.dep_graph.mark_loaded_from_cache(dep_node_index, true);
454-
}
455-
456452
result
457453
}
458454

@@ -528,10 +524,6 @@ impl<'tcx> TyCtxt<'tcx> {
528524

529525
drop(prof_timer);
530526

531-
if unlikely!(self.sess.opts.debugging_opts.query_dep_graph) {
532-
self.dep_graph.mark_loaded_from_cache(dep_node_index, false);
533-
}
534-
535527
if unlikely!(!diagnostics.is_empty()) {
536528
if dep_node.kind != crate::dep_graph::DepKind::Null {
537529
self.queries.on_disk_cache

0 commit comments

Comments
 (0)