Skip to content

Commit 6851874

Browse files
committed
Only hash dep node indices of deps of anon tasks
1 parent 46d0ca0 commit 6851874

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Diff for: src/librustc/dep_graph/graph.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -1021,25 +1021,17 @@ impl CurrentDepGraph {
10211021
fn complete_anon_task(&mut self, kind: DepKind, task_deps: TaskDeps) -> DepNodeIndex {
10221022
debug_assert!(!kind.is_eval_always());
10231023

1024-
let mut fingerprint = self.anon_id_seed;
10251024
let mut hasher = StableHasher::new();
10261025

1027-
for &read in task_deps.reads.iter() {
1028-
let read_dep_node = self.data[read].node;
1026+
task_deps.reads.hash(&mut hasher);
10291027

1030-
::std::mem::discriminant(&read_dep_node.kind).hash(&mut hasher);
1028+
let target_dep_node = DepNode {
1029+
kind,
10311030

10321031
// Fingerprint::combine() is faster than sending Fingerprint
10331032
// through the StableHasher (at least as long as StableHasher
10341033
// is so slow).
1035-
fingerprint = fingerprint.combine(read_dep_node.hash);
1036-
}
1037-
1038-
fingerprint = fingerprint.combine(hasher.finish());
1039-
1040-
let target_dep_node = DepNode {
1041-
kind,
1042-
hash: fingerprint,
1034+
hash: self.anon_id_seed.combine(hasher.finish()),
10431035
};
10441036

10451037
self.intern_node(target_dep_node, task_deps.reads, Fingerprint::ZERO).0

0 commit comments

Comments
 (0)