1
- use crate :: dep_graph:: { DepNodeIndex , SerializedDepNodeIndex } ;
1
+ use crate :: dep_graph:: DepNodeIndex ;
2
2
use crate :: hir;
3
3
use crate :: hir:: def_id:: { CrateNum , DefIndex , DefId , LocalDefId , LOCAL_CRATE } ;
4
4
use crate :: hir:: map:: definitions:: DefPathHash ;
@@ -62,11 +62,11 @@ pub struct OnDiskCache<'sess> {
62
62
63
63
// A map from dep-node to the position of the cached query result in
64
64
// `serialized_data`.
65
- query_result_index : FxHashMap < SerializedDepNodeIndex , AbsoluteBytePos > ,
65
+ query_result_index : FxHashMap < DepNodeIndex , AbsoluteBytePos > ,
66
66
67
67
// A map from dep-node to the position of any associated diagnostics in
68
68
// `serialized_data`.
69
- prev_diagnostics_index : FxHashMap < SerializedDepNodeIndex , AbsoluteBytePos > ,
69
+ prev_diagnostics_index : FxHashMap < DepNodeIndex , AbsoluteBytePos > ,
70
70
71
71
alloc_decoding_state : AllocDecodingState ,
72
72
}
@@ -82,8 +82,8 @@ struct Footer {
82
82
interpret_alloc_index : Vec < u32 > ,
83
83
}
84
84
85
- type EncodedQueryResultIndex = Vec < ( SerializedDepNodeIndex , AbsoluteBytePos ) > ;
86
- type EncodedDiagnosticsIndex = Vec < ( SerializedDepNodeIndex , AbsoluteBytePos ) > ;
85
+ type EncodedQueryResultIndex = Vec < ( DepNodeIndex , AbsoluteBytePos ) > ;
86
+ type EncodedDiagnosticsIndex = Vec < ( DepNodeIndex , AbsoluteBytePos ) > ;
87
87
type EncodedDiagnostics = Vec < Diagnostic > ;
88
88
89
89
#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
@@ -230,12 +230,12 @@ impl<'sess> OnDiskCache<'sess> {
230
230
use crate :: ty:: query:: config:: QueryDescription ;
231
231
if const_eval:: cache_on_disk ( tcx, key. clone ( ) ) {
232
232
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 ( ) ) ;
234
234
235
235
// Record position of the cache entry
236
236
qri. push ( ( dep_node, AbsoluteBytePos :: new ( enc. position ( ) ) ) ) ;
237
237
238
- // Encode the type check tables with the SerializedDepNodeIndex
238
+ // Encode the type check tables with the DepNodeIndex
239
239
// as tag.
240
240
enc. encode_tagged ( dep_node, value) ?;
241
241
}
@@ -253,7 +253,7 @@ impl<'sess> OnDiskCache<'sess> {
253
253
let pos = AbsoluteBytePos :: new ( encoder. position ( ) ) ;
254
254
// Let's make sure we get the expected type here:
255
255
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 ( ) ) ;
257
257
encoder. encode_tagged ( dep_node_index, diagnostics) ?;
258
258
259
259
Ok ( ( dep_node_index, pos) )
@@ -327,7 +327,7 @@ impl<'sess> OnDiskCache<'sess> {
327
327
pub fn load_diagnostics < ' tcx > (
328
328
& self ,
329
329
tcx : TyCtxt < ' tcx > ,
330
- dep_node_index : SerializedDepNodeIndex ,
330
+ dep_node_index : DepNodeIndex ,
331
331
) -> Vec < Diagnostic > {
332
332
let diagnostics: Option < EncodedDiagnostics > = self . load_indexed (
333
333
tcx,
@@ -352,11 +352,11 @@ impl<'sess> OnDiskCache<'sess> {
352
352
}
353
353
354
354
/// 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`.
356
356
pub fn try_load_query_result < ' tcx , T > (
357
357
& self ,
358
358
tcx : TyCtxt < ' tcx > ,
359
- dep_node_index : SerializedDepNodeIndex ,
359
+ dep_node_index : DepNodeIndex ,
360
360
) -> Option < T >
361
361
where
362
362
T : Decodable ,
@@ -386,8 +386,8 @@ impl<'sess> OnDiskCache<'sess> {
386
386
fn load_indexed < ' tcx , T > (
387
387
& self ,
388
388
tcx : TyCtxt < ' tcx > ,
389
- dep_node_index : SerializedDepNodeIndex ,
390
- index : & FxHashMap < SerializedDepNodeIndex , AbsoluteBytePos > ,
389
+ dep_node_index : DepNodeIndex ,
390
+ index : & FxHashMap < DepNodeIndex , AbsoluteBytePos > ,
391
391
debug_tag : & ' static str ,
392
392
) -> Option < T >
393
393
where
@@ -1091,12 +1091,12 @@ where
1091
1091
assert ! ( shards. iter( ) . all( |shard| shard. active. is_empty( ) ) ) ;
1092
1092
for ( key, entry) in shards. iter ( ) . flat_map ( |shard| shard. results . iter ( ) ) {
1093
1093
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 ( ) ) ;
1095
1095
1096
1096
// Record position of the cache entry
1097
1097
query_result_index. push ( ( dep_node, AbsoluteBytePos :: new ( encoder. position ( ) ) ) ) ;
1098
1098
1099
- // Encode the type check tables with the SerializedDepNodeIndex
1099
+ // Encode the type check tables with the DepNodeIndex
1100
1100
// as tag.
1101
1101
encoder. encode_tagged ( dep_node, & entry. value ) ?;
1102
1102
}
0 commit comments