1
+ use parking_lot:: Mutex ;
1
2
use rustc_data_structures:: fingerprint:: Fingerprint ;
2
3
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
3
4
use rustc_data_structures:: profiling:: { EventId , QueryInvocationId , SelfProfilerRef } ;
@@ -7,8 +8,6 @@ use rustc_data_structures::steal::Steal;
7
8
use rustc_data_structures:: sync:: { AtomicU32 , AtomicU64 , Lock , Lrc , Ordering } ;
8
9
use rustc_index:: vec:: IndexVec ;
9
10
use rustc_serialize:: opaque:: { FileEncodeResult , FileEncoder } ;
10
-
11
- use parking_lot:: Mutex ;
12
11
use smallvec:: { smallvec, SmallVec } ;
13
12
use std:: collections:: hash_map:: Entry ;
14
13
use std:: fmt:: Debug ;
@@ -19,6 +18,7 @@ use std::sync::atomic::Ordering::Relaxed;
19
18
use super :: query:: DepGraphQuery ;
20
19
use super :: serialized:: { GraphEncoder , SerializedDepGraph , SerializedDepNodeIndex } ;
21
20
use super :: { DepContext , DepKind , DepNode , HasDepContext , WorkProductId } ;
21
+ use crate :: ich:: StableHashingContext ;
22
22
use crate :: query:: { QueryContext , QuerySideEffects } ;
23
23
24
24
#[ cfg( debug_assertions) ]
@@ -96,9 +96,9 @@ struct DepGraphData<K: DepKind> {
96
96
dep_node_debug : Lock < FxHashMap < DepNode < K > , String > > ,
97
97
}
98
98
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 >
100
100
where
101
- R : HashStable < HashCtxt > ,
101
+ R : for < ' a > HashStable < StableHashingContext < ' a > > ,
102
102
{
103
103
let mut stable_hasher = StableHasher :: new ( ) ;
104
104
result. hash_stable ( hcx, & mut stable_hasher) ;
@@ -215,7 +215,7 @@ impl<K: DepKind> DepGraph<K> {
215
215
cx : Ctxt ,
216
216
arg : A ,
217
217
task : fn ( Ctxt , A ) -> R ,
218
- hash_result : fn ( & mut Ctxt :: StableHashingContext , & R ) -> Option < Fingerprint > ,
218
+ hash_result : fn ( & mut StableHashingContext < ' _ > , & R ) -> Option < Fingerprint > ,
219
219
) -> ( R , DepNodeIndex ) {
220
220
if self . is_fully_enabled ( ) {
221
221
self . with_task_impl ( key, cx, arg, task, hash_result)
@@ -234,7 +234,7 @@ impl<K: DepKind> DepGraph<K> {
234
234
cx : Ctxt ,
235
235
arg : A ,
236
236
task : fn ( Ctxt , A ) -> R ,
237
- hash_result : fn ( & mut Ctxt :: StableHashingContext , & R ) -> Option < Fingerprint > ,
237
+ hash_result : fn ( & mut StableHashingContext < ' _ > , & R ) -> Option < Fingerprint > ,
238
238
) -> ( R , DepNodeIndex ) {
239
239
// This function is only called when the graph is enabled.
240
240
let data = self . data . as_ref ( ) . unwrap ( ) ;
0 commit comments