@@ -15,7 +15,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
15
15
use rustc_query_system:: dep_graph:: DepContext ;
16
16
use rustc_query_system:: query:: { QueryCache , QueryContext , QuerySideEffects } ;
17
17
use rustc_serialize:: {
18
- opaque:: { self , FileEncodeResult , FileEncoder , IntEncodedWithFixedSize } ,
18
+ opaque:: { FileEncodeResult , FileEncoder , IntEncodedWithFixedSize , MemDecoder } ,
19
19
Decodable , Decoder , Encodable , Encoder ,
20
20
} ;
21
21
use rustc_session:: Session ;
@@ -159,7 +159,7 @@ impl<'sess> rustc_middle::ty::OnDiskCache<'sess> for OnDiskCache<'sess> {
159
159
160
160
// Wrap in a scope so we can borrow `data`.
161
161
let footer: Footer = {
162
- let mut decoder = opaque :: Decoder :: new ( & data, start_pos) ;
162
+ let mut decoder = MemDecoder :: new ( & data, start_pos) ;
163
163
164
164
// Decode the *position* of the footer, which can be found in the
165
165
// last 8 bytes of the file.
@@ -438,7 +438,7 @@ impl<'sess> OnDiskCache<'sess> {
438
438
let serialized_data = self . serialized_data . read ( ) ;
439
439
let mut decoder = CacheDecoder {
440
440
tcx,
441
- opaque : opaque :: Decoder :: new ( serialized_data. as_deref ( ) . unwrap_or ( & [ ] ) , pos. to_usize ( ) ) ,
441
+ opaque : MemDecoder :: new ( serialized_data. as_deref ( ) . unwrap_or ( & [ ] ) , pos. to_usize ( ) ) ,
442
442
source_map : self . source_map ,
443
443
file_index_to_file : & self . file_index_to_file ,
444
444
file_index_to_stable_id : & self . file_index_to_stable_id ,
@@ -459,7 +459,7 @@ impl<'sess> OnDiskCache<'sess> {
459
459
/// will also handle things that contain `Ty` instances.
460
460
pub struct CacheDecoder < ' a , ' tcx > {
461
461
tcx : TyCtxt < ' tcx > ,
462
- opaque : opaque :: Decoder < ' a > ,
462
+ opaque : MemDecoder < ' a > ,
463
463
source_map : & ' a SourceMap ,
464
464
file_index_to_file : & ' a Lock < FxHashMap < SourceFileIndex , Lrc < SourceFile > > > ,
465
465
file_index_to_stable_id : & ' a FxHashMap < SourceFileIndex , EncodedSourceFileId > ,
@@ -511,7 +511,7 @@ trait DecoderWithPosition: Decoder {
511
511
fn position ( & self ) -> usize ;
512
512
}
513
513
514
- impl < ' a > DecoderWithPosition for opaque :: Decoder < ' a > {
514
+ impl < ' a > DecoderWithPosition for MemDecoder < ' a > {
515
515
fn position ( & self ) -> usize {
516
516
self . position ( )
517
517
}
@@ -587,7 +587,7 @@ impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx> {
587
587
{
588
588
debug_assert ! ( pos < self . opaque. data. len( ) ) ;
589
589
590
- let new_opaque = opaque :: Decoder :: new ( self . opaque . data , pos) ;
590
+ let new_opaque = MemDecoder :: new ( self . opaque . data , pos) ;
591
591
let old_opaque = mem:: replace ( & mut self . opaque , new_opaque) ;
592
592
let r = f ( self ) ;
593
593
self . opaque = old_opaque;
0 commit comments