rustc_metadata::rmeta::encoder

Struct EncodeContext

Source
pub(super) struct EncodeContext<'a, 'tcx> {
Show 14 fields opaque: FileEncoder, tcx: TyCtxt<'tcx>, feat: &'tcx Features, tables: TableBuilders, lazy_state: LazyState, span_shorthands: FxHashMap<Span, usize>, type_shorthands: FxHashMap<Ty<'tcx>, usize>, predicate_shorthands: FxHashMap<PredicateKind<'tcx>, usize>, interpret_allocs: FxIndexSet<AllocId>, source_file_cache: (Lrc<SourceFile>, usize), required_source_files: Option<FxIndexSet<usize>>, is_proc_macro: bool, hygiene_ctxt: &'a HygieneEncodeContext, symbol_table: FxHashMap<Symbol, usize>,
}

Fields§

§opaque: FileEncoder§tcx: TyCtxt<'tcx>§feat: &'tcx Features§tables: TableBuilders§lazy_state: LazyState§span_shorthands: FxHashMap<Span, usize>§type_shorthands: FxHashMap<Ty<'tcx>, usize>§predicate_shorthands: FxHashMap<PredicateKind<'tcx>, usize>§interpret_allocs: FxIndexSet<AllocId>§source_file_cache: (Lrc<SourceFile>, usize)§required_source_files: Option<FxIndexSet<usize>>§is_proc_macro: bool§hygiene_ctxt: &'a HygieneEncodeContext§symbol_table: FxHashMap<Symbol, usize>

Implementations§

Source§

impl<'a, 'tcx> EncodeContext<'a, 'tcx>

Source

fn emit_lazy_distance(&mut self, position: NonZero<usize>)

Source

fn lazy<T: ParameterizedOverTcx, B: Borrow<T::Value<'tcx>>>( &mut self, value: B, ) -> LazyValue<T>
where T::Value<'tcx>: Encodable<EncodeContext<'a, 'tcx>>,

Source

fn lazy_array<T: ParameterizedOverTcx, I: IntoIterator<Item = B>, B: Borrow<T::Value<'tcx>>>( &mut self, values: I, ) -> LazyArray<T>
where T::Value<'tcx>: Encodable<EncodeContext<'a, 'tcx>>,

Source

fn encode_def_path_table(&mut self)

Source

fn encode_def_path_hash_map(&mut self) -> LazyValue<DefPathHashMapRef<'static>>

Source

fn encode_source_map(&mut self) -> LazyTable<u32, Option<LazyValue<SourceFile>>>

Source

fn encode_crate_root(&mut self) -> LazyValue<CrateRoot>

Source§

impl<'a, 'tcx> EncodeContext<'a, 'tcx>

Source

fn encode_attrs(&mut self, def_id: LocalDefId)

Source

fn encode_def_ids(&mut self)

Source

fn encode_info_for_adt(&mut self, local_def_id: LocalDefId)

Source

fn encode_info_for_mod(&mut self, local_def_id: LocalDefId)

Source

fn encode_explicit_item_bounds(&mut self, def_id: DefId)

Source

fn encode_explicit_item_super_predicates(&mut self, def_id: DefId)

Source

fn encode_info_for_assoc_item(&mut self, def_id: DefId)

Source

fn encode_precise_capturing_args(&mut self, def_id: DefId)

Source

fn encode_mir(&mut self)

Source

fn encode_stability(&mut self, def_id: DefId)

Source

fn encode_const_stability(&mut self, def_id: DefId)

Source

fn encode_default_body_stability(&mut self, def_id: DefId)

Source

fn encode_deprecation(&mut self, def_id: DefId)

Source

fn encode_info_for_macro(&mut self, def_id: LocalDefId)

Source

fn encode_native_libraries(&mut self) -> LazyArray<NativeLib>

Source

fn encode_foreign_modules(&mut self) -> LazyArray<ForeignModule>

Source

fn encode_hygiene( &mut self, ) -> (LazyTable<u32, Option<LazyValue<SyntaxContextData>>>, LazyTable<ExpnIndex, Option<LazyValue<ExpnData>>>, LazyTable<ExpnIndex, Option<LazyValue<ExpnHash>>>)

Source

fn encode_proc_macros(&mut self) -> Option<ProcMacroData>

Source

fn encode_debugger_visualizers(&mut self) -> LazyArray<DebuggerVisualizerFile>

Source

fn encode_crate_deps(&mut self) -> LazyArray<CrateDep>

Source

fn encode_lib_features(&mut self) -> LazyArray<(Symbol, FeatureStability)>

Source

fn encode_stability_implications(&mut self) -> LazyArray<(Symbol, Symbol)>

Source

fn encode_diagnostic_items(&mut self) -> LazyArray<(Symbol, DefIndex)>

Source

fn encode_lang_items(&mut self) -> LazyArray<(DefIndex, LangItem)>

Source

fn encode_lang_items_missing(&mut self) -> LazyArray<LangItem>

Source

fn encode_stripped_cfg_items(&mut self) -> LazyArray<StrippedCfgItem<DefIndex>>

Source

fn encode_traits(&mut self) -> LazyArray<DefIndex>

Source

fn encode_impls(&mut self) -> LazyArray<TraitImpls>

Encodes an index, mapping each trait to its (local) implementations.

Source

fn encode_incoherent_impls(&mut self) -> LazyArray<IncoherentImpls>

Source

fn encode_exported_symbols( &mut self, exported_symbols: &[(ExportedSymbol<'tcx>, SymbolExportInfo)], ) -> LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>

Source

fn encode_dylib_dependency_formats( &mut self, ) -> LazyArray<Option<LinkagePreference>>

Trait Implementations§

Source§

impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for CrateHeader

Source§

fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)

Source§

impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for CrateRoot

Source§

fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)

Source§

impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for IncoherentImpls

Source§

fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)

Source§

impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for LazyTables

Source§

fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)

Source§

impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for ProcMacroData

Source§

fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)

Source§

impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for TraitImpls

Source§

fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)

Source§

impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for [u8]

Source§

fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)

Source§

impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for DefPathHashMapRef<'tcx>

Source§

fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)

Source§

impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for ExpnIndex

Source§

fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)

Source§

impl<'a, 'tcx, T> Encodable<EncodeContext<'a, 'tcx>> for LazyArray<T>

Source§

fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)

Source§

impl<'a, 'tcx, I, T> Encodable<EncodeContext<'a, 'tcx>> for LazyTable<I, T>

Source§

fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)

Source§

impl<'a, 'tcx, T> Encodable<EncodeContext<'a, 'tcx>> for LazyValue<T>

Source§

fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)

Source§

impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for SpanData

Source§

fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)

Source§

impl<'a, 'tcx> Encoder for EncodeContext<'a, 'tcx>

Source§

fn emit_usize(&mut self, value: usize)

Source§

fn emit_u128(&mut self, value: u128)

Source§

fn emit_u64(&mut self, value: u64)

Source§

fn emit_u32(&mut self, value: u32)

Source§

fn emit_u16(&mut self, value: u16)

Source§

fn emit_u8(&mut self, value: u8)

Source§

fn emit_isize(&mut self, value: isize)

Source§

fn emit_i128(&mut self, value: i128)

Source§

fn emit_i64(&mut self, value: i64)

Source§

fn emit_i32(&mut self, value: i32)

Source§

fn emit_i16(&mut self, value: i16)

Source§

fn emit_raw_bytes(&mut self, value: &[u8])

Source§

fn emit_i8(&mut self, v: i8)

Source§

fn emit_bool(&mut self, v: bool)

Source§

fn emit_char(&mut self, v: char)

Source§

fn emit_str(&mut self, v: &str)

Source§

impl<'a, 'tcx> SpanEncoder for EncodeContext<'a, 'tcx>

Source§

fn encode_crate_num(&mut self, crate_num: CrateNum)

As a local identifier, a CrateNum is only meaningful within its context, e.g. within a tcx. Therefore, make sure to include the context when encode a CrateNum.
Source§

fn encode_def_index(&mut self, def_index: DefIndex)

Source§

fn encode_def_id(&mut self, def_id: DefId)

Source§

fn encode_syntax_context(&mut self, syntax_context: SyntaxContext)

Source§

fn encode_expn_id(&mut self, expn_id: ExpnId)

Source§

fn encode_span(&mut self, span: Span)

Source§

fn encode_symbol(&mut self, symbol: Symbol)

Source§

impl<'a, 'tcx> TyEncoder for EncodeContext<'a, 'tcx>

Source§

const CLEAR_CROSS_CRATE: bool = true

Source§

type I = TyCtxt<'tcx>

Source§

fn position(&self) -> usize

Source§

fn type_shorthands(&mut self) -> &mut FxHashMap<Ty<'tcx>, usize>

Source§

fn predicate_shorthands(&mut self) -> &mut FxHashMap<PredicateKind<'tcx>, usize>

Source§

fn encode_alloc_id(&mut self, alloc_id: &AllocId)

Auto Trait Implementations§

§

impl<'a, 'tcx> DynSend for EncodeContext<'a, 'tcx>

§

impl<'a, 'tcx> DynSync for EncodeContext<'a, 'tcx>

§

impl<'a, 'tcx> Freeze for EncodeContext<'a, 'tcx>

§

impl<'a, 'tcx> !RefUnwindSafe for EncodeContext<'a, 'tcx>

§

impl<'a, 'tcx> !Send for EncodeContext<'a, 'tcx>

§

impl<'a, 'tcx> !Sync for EncodeContext<'a, 'tcx>

§

impl<'a, 'tcx> Unpin for EncodeContext<'a, 'tcx>

§

impl<'a, 'tcx> !UnwindSafe for EncodeContext<'a, 'tcx>

Blanket Implementations§

Source§

impl<T> Aligned for T

Source§

const ALIGN: Alignment

Alignment of Self.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, R> CollectAndApply<T, R> for T

Source§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

Source§

type Output = R

Source§

impl<T> Filterable for T

Source§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<P> IntoQueryParam<P> for P

Source§

impl<T> MaybeResult<T> for T

Source§

type Error = !

Source§

fn from(_: Result<T, <T as MaybeResult<T>>::Error>) -> T

Source§

fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

Source§

fn upcast(self, interner: I) -> U

Source§

impl<I, T> UpcastFrom<I, T> for T

Source§

fn upcast_from(from: T, _tcx: I) -> T

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<Tcx, T> Value<Tcx> for T
where Tcx: DepContext,

Source§

default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

Source§

impl<T> ErasedDestructor for T
where 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: 2768 bytes