pub(super) struct EncodeContext<'a, 'tcx> {
Show 13 fields opaque: FileEncoder, tcx: TyCtxt<'tcx>, feat: &'tcx Features, tables: TableBuilders, lazy_state: LazyState, 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§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: NonZeroUsize)

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_info_for_items(&mut self)

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, def_id: DefId)

source

fn encode_info_for_mod(&mut self, local_def_id: LocalDefId, md: &Mod<'_>)

source

fn encode_explicit_item_bounds(&mut self, def_id: DefId)

source

fn encode_info_for_trait_item(&mut self, def_id: DefId)

source

fn encode_info_for_impl_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_rendered_const_for_body(&mut self, body_id: BodyId) -> String

source

fn encode_info_for_item(&mut self, def_id: DefId, item: &'tcx Item<'tcx>)

source

fn encode_info_for_closure(&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, Option<Symbol>)>

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

source

fn encode_info_for_foreign_item( &mut self, def_id: DefId, nitem: &ForeignItem<'_> )

source§

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

source

fn encode_info_for_generics(&mut self, generics: &Generics<'tcx>)

source

fn encode_info_for_expr(&mut self, expr: &Expr<'_>)

Trait Implementations§

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 CrateNum

source§

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

source§

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

source§

fn encode(&self, s: &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 ExpnId

source§

fn encode(&self, s: &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 Span

source§

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

source§

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

source§

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

source§

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

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_i8(&mut self, value: i8)

source§

fn emit_bool(&mut self, value: bool)

source§

fn emit_f64(&mut self, value: f64)

source§

fn emit_f32(&mut self, value: f32)

source§

fn emit_char(&mut self, value: char)

source§

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

source§

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

source§

fn emit_enum_variant<F>(&mut self, v_id: usize, f: F)where F: FnOnce(&mut Self),

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)

source§

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

§

type NestedFilter = OnlyBodies

Override this type to control which nested HIR are visited; see NestedFilter for details. If you override this type, you must also override nested_visit_map. Read more
source§

fn nested_visit_map(&mut self) -> Self::Map

If type NestedFilter is set to visit nested items, this method must also be overridden to provide a map to retrieve nested items.
source§

fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>)

source§

fn visit_item(&mut self, item: &'tcx Item<'tcx>)

Visits the top-level item and (optionally) nested items / impl items. See visit_nested_item for details.
source§

fn visit_foreign_item(&mut self, ni: &'tcx ForeignItem<'tcx>)

source§

fn visit_generics(&mut self, generics: &'tcx Generics<'tcx>)

§

type Map = <Self::NestedFilter as NestedFilter<'v>>::Map

source§

fn visit_nested_item(&mut self, id: ItemId)

Invoked when a nested item is encountered. By default, when Self::NestedFilter is nested_filter::None, this method does nothing. You probably don’t want to override this method – instead, override Self::NestedFilter or use the “shallow” or “deep” visit patterns described on itemlikevisit::ItemLikeVisitor. The only reason to override this method is if you want a nested pattern but cannot supply a Map; see nested_visit_map for advice.
source§

fn visit_nested_trait_item(&mut self, id: TraitItemId)

Like visit_nested_item(), but for trait items. See visit_nested_item() for advice on when to override this method.
source§

fn visit_nested_impl_item(&mut self, id: ImplItemId)

Like visit_nested_item(), but for impl items. See visit_nested_item() for advice on when to override this method.
source§

fn visit_nested_foreign_item(&mut self, id: ForeignItemId)

Like visit_nested_item(), but for foreign items. See visit_nested_item() for advice on when to override this method.
source§

fn visit_nested_body(&mut self, id: BodyId)

Invoked to visit the body of a function, method or closure. Like visit_nested_item, does nothing by default unless you override Self::NestedFilter.
source§

fn visit_param(&mut self, param: &'v Param<'v>)

source§

fn visit_body(&mut self, b: &'v Body<'v>)

source§

fn visit_id(&mut self, _hir_id: HirId)

source§

fn visit_name(&mut self, _name: Symbol)

source§

fn visit_ident(&mut self, ident: Ident)

source§

fn visit_mod(&mut self, m: &'v Mod<'v>, _s: Span, n: HirId)

source§

fn visit_local(&mut self, l: &'v Local<'v>)

source§

fn visit_block(&mut self, b: &'v Block<'v>)

source§

fn visit_stmt(&mut self, s: &'v Stmt<'v>)

source§

fn visit_arm(&mut self, a: &'v Arm<'v>)

source§

fn visit_pat(&mut self, p: &'v Pat<'v>)

source§

fn visit_pat_field(&mut self, f: &'v PatField<'v>)

source§

fn visit_array_length(&mut self, len: &'v ArrayLen)

source§

fn visit_anon_const(&mut self, c: &'v AnonConst)

source§

fn visit_let_expr(&mut self, lex: &'v Let<'v>)

source§

fn visit_expr_field(&mut self, field: &'v ExprField<'v>)

source§

fn visit_ty(&mut self, t: &'v Ty<'v>)

source§

fn visit_generic_param(&mut self, p: &'v GenericParam<'v>)

source§

fn visit_const_param_default(&mut self, _param: HirId, ct: &'v AnonConst)

source§

fn visit_where_predicate(&mut self, predicate: &'v WherePredicate<'v>)

source§

fn visit_fn_ret_ty(&mut self, ret_ty: &'v FnRetTy<'v>)

source§

fn visit_fn_decl(&mut self, fd: &'v FnDecl<'v>)

source§

fn visit_fn( &mut self, fk: FnKind<'v>, fd: &'v FnDecl<'v>, b: BodyId, _: Span, id: LocalDefId )

source§

fn visit_use( &mut self, path: &'v Path<'v, SmallVec<[Res<HirId>; 3]>>, hir_id: HirId )

source§

fn visit_trait_item(&mut self, ti: &'v TraitItem<'v>)

source§

fn visit_trait_item_ref(&mut self, ii: &'v TraitItemRef)

source§

fn visit_impl_item(&mut self, ii: &'v ImplItem<'v>)

source§

fn visit_foreign_item_ref(&mut self, ii: &'v ForeignItemRef)

source§

fn visit_impl_item_ref(&mut self, ii: &'v ImplItemRef)

source§

fn visit_trait_ref(&mut self, t: &'v TraitRef<'v>)

source§

fn visit_param_bound(&mut self, bounds: &'v GenericBound<'v>)

source§

fn visit_poly_trait_ref(&mut self, t: &'v PolyTraitRef<'v>)

source§

fn visit_variant_data(&mut self, s: &'v VariantData<'v>)

source§

fn visit_field_def(&mut self, s: &'v FieldDef<'v>)

source§

fn visit_enum_def(&mut self, enum_definition: &'v EnumDef<'v>, item_id: HirId)

source§

fn visit_variant(&mut self, v: &'v Variant<'v>)

source§

fn visit_label(&mut self, label: &'v Label)

source§

fn visit_infer(&mut self, inf: &'v InferArg)

source§

fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg<'v>)

source§

fn visit_lifetime(&mut self, lifetime: &'v Lifetime)

source§

fn visit_qpath(&mut self, qpath: &'v QPath<'v>, id: HirId, _span: Span)

source§

fn visit_path(&mut self, path: &Path<'v, Res<HirId>>, _id: HirId)

source§

fn visit_path_segment(&mut self, path_segment: &'v PathSegment<'v>)

source§

fn visit_generic_args(&mut self, generic_args: &'v GenericArgs<'v>)

source§

fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding<'v>)

source§

fn visit_attribute(&mut self, _attr: &'v Attribute)

source§

fn visit_associated_item_kind(&mut self, kind: &'v AssocItemKind)

source§

fn visit_defaultness(&mut self, defaultness: &'v Defaultness)

source§

fn visit_inline_asm(&mut self, asm: &'v InlineAsm<'v>, id: HirId)

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.

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