@@ -1021,25 +1021,22 @@ 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+ // The dep node indices are hashed here instead of hashing the dep nodes of the
1027+ // dependencies. These indices may refer to different nodes per session, but this isn't
1028+ // a problem here because we that ensure the final dep node hash is per session only by
1029+ // combining it with the per session random number `anon_id_seed`. This hash only need
1030+ // to map the dependencies to a single value on a per session basis.
1031+ task_deps. reads . hash ( & mut hasher) ;
10291032
1030- :: std:: mem:: discriminant ( & read_dep_node. kind ) . hash ( & mut hasher) ;
1033+ let target_dep_node = DepNode {
1034+ kind,
10311035
10321036 // Fingerprint::combine() is faster than sending Fingerprint
10331037 // through the StableHasher (at least as long as StableHasher
10341038 // 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,
1039+ hash : self . anon_id_seed . combine ( hasher. finish ( ) ) ,
10431040 } ;
10441041
10451042 self . intern_node ( target_dep_node, task_deps. reads , Fingerprint :: ZERO ) . 0
0 commit comments