Struct rustc_middle::query::on_disk_cache::CacheDecoder
source · pub struct CacheDecoder<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
opaque: MemDecoder<'a>,
source_map: &'a SourceMap,
file_index_to_file: &'a Lock<FxHashMap<SourceFileIndex, Lrc<SourceFile>>>,
file_index_to_stable_id: &'a FxHashMap<SourceFileIndex, EncodedSourceFileId>,
alloc_decoding_session: AllocDecodingSession<'a>,
syntax_contexts: &'a FxHashMap<u32, AbsoluteBytePos>,
expn_data: &'a UnhashMap<ExpnHash, AbsoluteBytePos>,
foreign_expn_data: &'a UnhashMap<ExpnHash, u32>,
hygiene_context: &'a HygieneDecodeContext,
}
Expand description
A decoder that can read from the incremental compilation cache. It is similar to the one
we use for crate metadata decoding in that it can rebase spans and eventually
will also handle things that contain Ty
instances.
Fields§
§tcx: TyCtxt<'tcx>
§opaque: MemDecoder<'a>
§source_map: &'a SourceMap
§file_index_to_file: &'a Lock<FxHashMap<SourceFileIndex, Lrc<SourceFile>>>
§file_index_to_stable_id: &'a FxHashMap<SourceFileIndex, EncodedSourceFileId>
§alloc_decoding_session: AllocDecodingSession<'a>
§syntax_contexts: &'a FxHashMap<u32, AbsoluteBytePos>
§expn_data: &'a UnhashMap<ExpnHash, AbsoluteBytePos>
§foreign_expn_data: &'a UnhashMap<ExpnHash, u32>
§hygiene_context: &'a HygieneDecodeContext
Implementations§
source§impl<'a, 'tcx> CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> CacheDecoder<'a, 'tcx>
fn file_index_to_file(&self, index: SourceFileIndex) -> Lrc<SourceFile>
Trait Implementations§
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [(Clause<'tcx>, Span)]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [(Clause<'tcx>, Span)]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [(ExportedSymbol<'tcx>, SymbolExportInfo)]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [(ExportedSymbol<'tcx>, SymbolExportInfo)]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Attribute]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Attribute]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [DeducedParamAttrs]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [DeducedParamAttrs]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [DefId]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [DefId]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Ident]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Ident]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [InlineAsmTemplatePiece]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [InlineAsmTemplatePiece]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [LocalDefId]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [LocalDefId]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Span]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Span]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Variance]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Variance]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx FxHashMap<DefId, EarlyBinder<Ty<'tcx>>>
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx FxHashMap<DefId, EarlyBinder<Ty<'tcx>>>
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx IndexVec<Promoted, Body<'tcx>>
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx IndexVec<Promoted, Body<'tcx>>
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx UnordSet<LocalDefId>
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx UnordSet<LocalDefId>
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for CrateNum
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for CrateNum
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefId
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefId
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefIndex
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefIndex
fn decode(_d: &mut CacheDecoder<'a, 'tcx>) -> DefIndex
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for ExpnId
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for ExpnId
fn decode(decoder: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Span
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Span
fn decode(decoder: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Symbol
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Symbol
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for SyntaxContext
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for SyntaxContext
fn decode(decoder: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Vec<u8>
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Vec<u8>
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decoder for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> Decoder for CacheDecoder<'a, 'tcx>
fn read_usize(&mut self) -> usize
fn read_u128(&mut self) -> u128
fn read_u64(&mut self) -> u64
fn read_u32(&mut self) -> u32
fn read_u16(&mut self) -> u16
fn read_u8(&mut self) -> u8
fn read_isize(&mut self) -> isize
fn read_i128(&mut self) -> i128
fn read_i64(&mut self) -> i64
fn read_i32(&mut self) -> i32
fn read_i16(&mut self) -> i16
fn read_raw_bytes(&mut self, len: usize) -> &[u8] ⓘ
fn peek_byte(&self) -> u8
fn position(&self) -> usize
fn read_i8(&mut self) -> i8
fn read_bool(&mut self) -> bool
fn read_char(&mut self) -> char
fn read_str(&mut self) -> &str
source§impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx>
type I = TyCtxt<'tcx>
const CLEAR_CROSS_CRATE: bool = false
fn interner(&self) -> TyCtxt<'tcx>
fn cached_ty_for_shorthand<F>( &mut self, shorthand: usize, or_insert_with: F ) -> Ty<'tcx>where F: FnOnce(&mut Self) -> Ty<'tcx>,
fn with_position<F, R>(&mut self, pos: usize, f: F) -> Rwhere F: FnOnce(&mut Self) -> R,
fn decode_alloc_id(&mut self) -> AllocId
fn positioned_at_shorthand(&self) -> bool
Auto Trait Implementations§
impl<'a, 'tcx> !RefUnwindSafe for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> !Send for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> !Sync for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> Unpin for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for CacheDecoder<'a, 'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle: &[QueryInfo], _guar: ErrorGuaranteed ) -> T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 104 bytes