1+ use parking_lot:: Mutex ;
12use rustc_data_structures:: fingerprint:: Fingerprint ;
23use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
34use rustc_data_structures:: profiling:: { EventId , QueryInvocationId , SelfProfilerRef } ;
@@ -7,8 +8,6 @@ use rustc_data_structures::steal::Steal;
78use rustc_data_structures:: sync:: { AtomicU32 , AtomicU64 , Lock , Lrc , Ordering } ;
89use rustc_index:: vec:: IndexVec ;
910use rustc_serialize:: opaque:: { FileEncodeResult , FileEncoder } ;
10-
11- use parking_lot:: Mutex ;
1211use smallvec:: { smallvec, SmallVec } ;
1312use std:: collections:: hash_map:: Entry ;
1413use std:: fmt:: Debug ;
@@ -19,6 +18,7 @@ use std::sync::atomic::Ordering::Relaxed;
1918use super :: query:: DepGraphQuery ;
2019use super :: serialized:: { GraphEncoder , SerializedDepGraph , SerializedDepNodeIndex } ;
2120use super :: { DepContext , DepKind , DepNode , HasDepContext , WorkProductId } ;
21+ use crate :: ich:: StableHashingContext ;
2222use crate :: query:: { QueryContext , QuerySideEffects } ;
2323
2424#[ cfg( debug_assertions) ]
@@ -96,9 +96,9 @@ struct DepGraphData<K: DepKind> {
9696 dep_node_debug : Lock < FxHashMap < DepNode < K > , String > > ,
9797}
9898
99- pub fn hash_result < HashCtxt , R > ( hcx : & mut HashCtxt , result : & R ) -> Option < Fingerprint >
99+ pub fn hash_result < R > ( hcx : & mut StableHashingContext < ' _ > , result : & R ) -> Option < Fingerprint >
100100where
101- R : HashStable < HashCtxt > ,
101+ R : for < ' a > HashStable < StableHashingContext < ' a > > ,
102102{
103103 let mut stable_hasher = StableHasher :: new ( ) ;
104104 result. hash_stable ( hcx, & mut stable_hasher) ;
@@ -215,7 +215,7 @@ impl<K: DepKind> DepGraph<K> {
215215 cx : Ctxt ,
216216 arg : A ,
217217 task : fn ( Ctxt , A ) -> R ,
218- hash_result : fn ( & mut Ctxt :: StableHashingContext , & R ) -> Option < Fingerprint > ,
218+ hash_result : fn ( & mut StableHashingContext < ' _ > , & R ) -> Option < Fingerprint > ,
219219 ) -> ( R , DepNodeIndex ) {
220220 if self . is_fully_enabled ( ) {
221221 self . with_task_impl ( key, cx, arg, task, hash_result)
@@ -234,7 +234,7 @@ impl<K: DepKind> DepGraph<K> {
234234 cx : Ctxt ,
235235 arg : A ,
236236 task : fn ( Ctxt , A ) -> R ,
237- hash_result : fn ( & mut Ctxt :: StableHashingContext , & R ) -> Option < Fingerprint > ,
237+ hash_result : fn ( & mut StableHashingContext < ' _ > , & R ) -> Option < Fingerprint > ,
238238 ) -> ( R , DepNodeIndex ) {
239239 // This function is only called when the graph is enabled.
240240 let data = self . data . as_ref ( ) . unwrap ( ) ;
0 commit comments