Struct rustc_metadata::rmeta::encoder::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_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

§

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<_>>()).

§

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

§

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.
§

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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: 2672 bytes