1- use crate :: dep_graph:: { DepNodeIndex , SerializedDepNodeIndex } ;
1+ use crate :: dep_graph:: DepNodeIndex ;
22use crate :: hir;
33use crate :: hir:: def_id:: { CrateNum , DefIndex , DefId , LocalDefId , LOCAL_CRATE } ;
44use crate :: hir:: map:: definitions:: DefPathHash ;
@@ -62,11 +62,11 @@ pub struct OnDiskCache<'sess> {
6262
6363 // A map from dep-node to the position of the cached query result in
6464 // `serialized_data`.
65- query_result_index : FxHashMap < SerializedDepNodeIndex , AbsoluteBytePos > ,
65+ query_result_index : FxHashMap < DepNodeIndex , AbsoluteBytePos > ,
6666
6767 // A map from dep-node to the position of any associated diagnostics in
6868 // `serialized_data`.
69- prev_diagnostics_index : FxHashMap < SerializedDepNodeIndex , AbsoluteBytePos > ,
69+ prev_diagnostics_index : FxHashMap < DepNodeIndex , AbsoluteBytePos > ,
7070
7171 alloc_decoding_state : AllocDecodingState ,
7272}
@@ -82,8 +82,8 @@ struct Footer {
8282 interpret_alloc_index : Vec < u32 > ,
8383}
8484
85- type EncodedQueryResultIndex = Vec < ( SerializedDepNodeIndex , AbsoluteBytePos ) > ;
86- type EncodedDiagnosticsIndex = Vec < ( SerializedDepNodeIndex , AbsoluteBytePos ) > ;
85+ type EncodedQueryResultIndex = Vec < ( DepNodeIndex , AbsoluteBytePos ) > ;
86+ type EncodedDiagnosticsIndex = Vec < ( DepNodeIndex , AbsoluteBytePos ) > ;
8787type EncodedDiagnostics = Vec < Diagnostic > ;
8888
8989#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
@@ -230,12 +230,12 @@ impl<'sess> OnDiskCache<'sess> {
230230 use crate :: ty:: query:: config:: QueryDescription ;
231231 if const_eval:: cache_on_disk ( tcx, key. clone ( ) ) {
232232 if let Ok ( ref value) = entry. value {
233- let dep_node = SerializedDepNodeIndex :: new ( entry. index . index ( ) ) ;
233+ let dep_node = DepNodeIndex :: new ( entry. index . index ( ) ) ;
234234
235235 // Record position of the cache entry
236236 qri. push ( ( dep_node, AbsoluteBytePos :: new ( enc. position ( ) ) ) ) ;
237237
238- // Encode the type check tables with the SerializedDepNodeIndex
238+ // Encode the type check tables with the DepNodeIndex
239239 // as tag.
240240 enc. encode_tagged ( dep_node, value) ?;
241241 }
@@ -253,7 +253,7 @@ impl<'sess> OnDiskCache<'sess> {
253253 let pos = AbsoluteBytePos :: new ( encoder. position ( ) ) ;
254254 // Let's make sure we get the expected type here:
255255 let diagnostics: & EncodedDiagnostics = diagnostics;
256- let dep_node_index = SerializedDepNodeIndex :: new ( dep_node_index. index ( ) ) ;
256+ let dep_node_index = DepNodeIndex :: new ( dep_node_index. index ( ) ) ;
257257 encoder. encode_tagged ( dep_node_index, diagnostics) ?;
258258
259259 Ok ( ( dep_node_index, pos) )
@@ -327,7 +327,7 @@ impl<'sess> OnDiskCache<'sess> {
327327 pub fn load_diagnostics < ' tcx > (
328328 & self ,
329329 tcx : TyCtxt < ' tcx > ,
330- dep_node_index : SerializedDepNodeIndex ,
330+ dep_node_index : DepNodeIndex ,
331331 ) -> Vec < Diagnostic > {
332332 let diagnostics: Option < EncodedDiagnostics > = self . load_indexed (
333333 tcx,
@@ -352,11 +352,11 @@ impl<'sess> OnDiskCache<'sess> {
352352 }
353353
354354 /// Returns the cached query result if there is something in the cache for
355- /// the given `SerializedDepNodeIndex `; otherwise returns `None`.
355+ /// the given `DepNodeIndex `; otherwise returns `None`.
356356 pub fn try_load_query_result < ' tcx , T > (
357357 & self ,
358358 tcx : TyCtxt < ' tcx > ,
359- dep_node_index : SerializedDepNodeIndex ,
359+ dep_node_index : DepNodeIndex ,
360360 ) -> Option < T >
361361 where
362362 T : Decodable ,
@@ -386,8 +386,8 @@ impl<'sess> OnDiskCache<'sess> {
386386 fn load_indexed < ' tcx , T > (
387387 & self ,
388388 tcx : TyCtxt < ' tcx > ,
389- dep_node_index : SerializedDepNodeIndex ,
390- index : & FxHashMap < SerializedDepNodeIndex , AbsoluteBytePos > ,
389+ dep_node_index : DepNodeIndex ,
390+ index : & FxHashMap < DepNodeIndex , AbsoluteBytePos > ,
391391 debug_tag : & ' static str ,
392392 ) -> Option < T >
393393 where
@@ -1091,12 +1091,12 @@ where
10911091 assert ! ( shards. iter( ) . all( |shard| shard. active. is_empty( ) ) ) ;
10921092 for ( key, entry) in shards. iter ( ) . flat_map ( |shard| shard. results . iter ( ) ) {
10931093 if Q :: cache_on_disk ( tcx, key. clone ( ) ) {
1094- let dep_node = SerializedDepNodeIndex :: new ( entry. index . index ( ) ) ;
1094+ let dep_node = DepNodeIndex :: new ( entry. index . index ( ) ) ;
10951095
10961096 // Record position of the cache entry
10971097 query_result_index. push ( ( dep_node, AbsoluteBytePos :: new ( encoder. position ( ) ) ) ) ;
10981098
1099- // Encode the type check tables with the SerializedDepNodeIndex
1099+ // Encode the type check tables with the DepNodeIndex
11001100 // as tag.
11011101 encoder. encode_tagged ( dep_node, & entry. value ) ?;
11021102 }
0 commit comments