@@ -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 ;
@@ -158,7 +158,7 @@ impl<'sess> rustc_middle::ty::OnDiskCache<'sess> for OnDiskCache<'sess> {
158
158
159
159
// Wrap in a scope so we can borrow `data`.
160
160
let footer: Footer = {
161
- let mut decoder = opaque :: Decoder :: new ( & data, start_pos) ;
161
+ let mut decoder = MemDecoder :: new ( & data, start_pos) ;
162
162
163
163
// Decode the *position* of the footer, which can be found in the
164
164
// last 8 bytes of the file.
@@ -437,7 +437,7 @@ impl<'sess> OnDiskCache<'sess> {
437
437
let serialized_data = self . serialized_data . read ( ) ;
438
438
let mut decoder = CacheDecoder {
439
439
tcx,
440
- opaque : opaque :: Decoder :: new ( serialized_data. as_deref ( ) . unwrap_or ( & [ ] ) , pos. to_usize ( ) ) ,
440
+ opaque : MemDecoder :: new ( serialized_data. as_deref ( ) . unwrap_or ( & [ ] ) , pos. to_usize ( ) ) ,
441
441
source_map : self . source_map ,
442
442
file_index_to_file : & self . file_index_to_file ,
443
443
file_index_to_stable_id : & self . file_index_to_stable_id ,
@@ -458,7 +458,7 @@ impl<'sess> OnDiskCache<'sess> {
458
458
/// will also handle things that contain `Ty` instances.
459
459
pub struct CacheDecoder < ' a , ' tcx > {
460
460
tcx : TyCtxt < ' tcx > ,
461
- opaque : opaque :: Decoder < ' a > ,
461
+ opaque : MemDecoder < ' a > ,
462
462
source_map : & ' a SourceMap ,
463
463
file_index_to_file : & ' a Lock < FxHashMap < SourceFileIndex , Lrc < SourceFile > > > ,
464
464
file_index_to_stable_id : & ' a FxHashMap < SourceFileIndex , EncodedSourceFileId > ,
@@ -510,7 +510,7 @@ trait DecoderWithPosition: Decoder {
510
510
fn position ( & self ) -> usize ;
511
511
}
512
512
513
- impl < ' a > DecoderWithPosition for opaque :: Decoder < ' a > {
513
+ impl < ' a > DecoderWithPosition for MemDecoder < ' a > {
514
514
fn position ( & self ) -> usize {
515
515
self . position ( )
516
516
}
@@ -586,7 +586,7 @@ impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx> {
586
586
{
587
587
debug_assert ! ( pos < self . opaque. data. len( ) ) ;
588
588
589
- let new_opaque = opaque :: Decoder :: new ( self . opaque . data , pos) ;
589
+ let new_opaque = MemDecoder :: new ( self . opaque . data , pos) ;
590
590
let old_opaque = mem:: replace ( & mut self . opaque , new_opaque) ;
591
591
let r = f ( self ) ;
592
592
self . opaque = old_opaque;
0 commit comments