Struct rustc_query_impl::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
sourceimpl<'a, 'tcx> CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> CacheDecoder<'a, 'tcx>
fn file_index_to_file(&self, index: SourceFileIndex) -> Lrc<SourceFile>
Trait Implementations
sourceimpl<'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
sourceimpl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [(Predicate<'tcx>, Span)]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [(Predicate<'tcx>, Span)]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Node<'tcx>]
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Node<'tcx>]
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
sourceimpl<'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
sourceimpl<'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
sourceimpl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx FxHashMap<DefId, Ty<'tcx>>
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx FxHashMap<DefId, Ty<'tcx>>
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
sourceimpl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx FxHashSet<LocalDefId>
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx FxHashSet<LocalDefId>
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'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
sourceimpl<'a, 'tcx> Decoder for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> Decoder for CacheDecoder<'a, 'tcx>
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_usize(&mut self) -> usize
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_i8(&mut self) -> i8
fn read_isize(&mut self) -> isize
fn read_bool(&mut self) -> bool
fn read_f64(&mut self) -> f64
fn read_f32(&mut self) -> f32
fn read_char(&mut self) -> char
fn read_str(&mut self) -> &str
fn read_raw_bytes(&mut self, len: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
sourceimpl<'a, 'tcx> DecoderWithPosition for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> DecoderWithPosition for CacheDecoder<'a, 'tcx>
sourceimpl<'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 position(&self) -> usize
fn peek_byte(&self) -> u8
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<CTX, T> Value<CTX> for Twhere
CTX: DepContext,
impl<CTX, T> Value<CTX> for Twhere
CTX: DepContext,
default fn from_cycle_error(tcx: CTX) -> 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