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 Graph
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx Graph
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 UnordMap<DefId, EarlyBinder<'tcx, Ty<'tcx>>>
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx UnordMap<DefId, EarlyBinder<'tcx, Ty<'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 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> SpanDecoder for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> SpanDecoder for CacheDecoder<'a, 'tcx>
fn decode_syntax_context(&mut self) -> SyntaxContext
fn decode_expn_id(&mut self) -> ExpnId
fn decode_span(&mut self) -> Span
fn decode_symbol(&mut self) -> Symbol
fn decode_crate_num(&mut self) -> CrateNum
fn decode_def_index(&mut self) -> DefIndex
fn decode_def_id(&mut self) -> DefId
fn decode_attr_id(&mut self) -> AttrId
source§impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx>
const CLEAR_CROSS_CRATE: bool = false
type I = TyCtxt<'tcx>
fn interner(&self) -> TyCtxt<'tcx>
fn cached_ty_for_shorthand<F>( &mut self, shorthand: usize, or_insert_with: F, ) -> 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> !DynSend for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> !DynSync for CacheDecoder<'a, 'tcx>
impl<'a, 'tcx> Freeze for CacheDecoder<'a, 'tcx>
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<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§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<T> Pointable for T
impl<T> Pointable for T
source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> 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_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
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: 96 bytes