@@ -12,6 +12,7 @@ use super::*;
12
12
13
13
use dep_graph:: { DepGraph , DepKind , DepNodeIndex } ;
14
14
use hir:: intravisit:: { Visitor , NestedVisitorMap } ;
15
+ use middle:: cstore:: CrateStore ;
15
16
use session:: CrateDisambiguator ;
16
17
use std:: iter:: repeat;
17
18
use syntax:: ast:: { NodeId , CRATE_NODE_ID } ;
@@ -119,7 +120,9 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
119
120
}
120
121
121
122
pub ( super ) fn finalize_and_compute_crate_hash ( self ,
122
- crate_disambiguator : CrateDisambiguator )
123
+ crate_disambiguator : CrateDisambiguator ,
124
+ cstore : & CrateStore ,
125
+ commandline_args_hash : u64 )
123
126
-> Vec < MapEntry < ' hir > > {
124
127
let mut node_hashes: Vec < _ > = self
125
128
. hir_body_nodes
@@ -132,9 +135,23 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
132
135
133
136
node_hashes. sort_unstable_by ( |& ( ref d1, _) , & ( ref d2, _) | d1. cmp ( d2) ) ;
134
137
138
+ let mut upstream_crates: Vec < _ > = cstore. crates_untracked ( ) . iter ( ) . map ( |& cnum| {
139
+ let name = cstore. crate_name_untracked ( cnum) . as_str ( ) ;
140
+ let disambiguator = cstore. crate_disambiguator_untracked ( cnum)
141
+ . to_fingerprint ( ) ;
142
+ let hash = cstore. crate_hash_untracked ( cnum) ;
143
+ ( name, disambiguator, hash)
144
+ } ) . collect ( ) ;
145
+
146
+ upstream_crates. sort_unstable_by ( |& ( name1, dis1, _) , & ( name2, dis2, _) | {
147
+ ( name1, dis1) . cmp ( & ( name2, dis2) )
148
+ } ) ;
149
+
135
150
self . dep_graph . with_task ( DepNode :: new_no_params ( DepKind :: Krate ) ,
136
151
& self . hcx ,
137
- ( node_hashes, crate_disambiguator. to_fingerprint ( ) ) ,
152
+ ( ( node_hashes, upstream_crates) ,
153
+ ( commandline_args_hash,
154
+ crate_disambiguator. to_fingerprint ( ) ) ) ,
138
155
identity_fn) ;
139
156
self . map
140
157
}
0 commit comments