Struct rustc_typeck::check::inherited::Inherited[−][src]

pub struct Inherited<'a, 'tcx> {
    pub(super) infcx: InferCtxt<'a, 'tcx>,
    pub(super) typeck_results: MaybeInProgressTables<'a, 'tcx>,
    pub(super) locals: RefCell<HirIdMap<LocalTy<'tcx>>>,
    pub(super) fulfillment_cx: RefCell<Box<dyn TraitEngine<'tcx>>>,
    pub(super) deferred_sized_obligations: RefCell<Vec<(Ty<'tcx>, Span, ObligationCauseCode<'tcx>)>>,
    pub(super) deferred_call_resolutions: RefCell<DefIdMap<Vec<DeferredCallResolution<'tcx>>>>,
    pub(super) deferred_cast_checks: RefCell<Vec<CastCheck<'tcx>>>,
    pub(super) deferred_generator_interiors: RefCell<Vec<(BodyId, Ty<'tcx>, GeneratorKind)>>,
    pub(super) opaque_types: RefCell<VecMap<OpaqueTypeKey<'tcx>, OpaqueTypeDecl<'tcx>>>,
    pub(super) opaque_types_vars: RefCell<FxHashMap<Ty<'tcx>, Ty<'tcx>>>,
    pub(super) body_id: Option<BodyId>,
}
Expand description

Closures defined within the function. For example:

fn foo() {
    bar(move|| { ... })
}

Here, the function foo() and the closure passed to bar() will each have their own FnCtxt, but they will share the inherited fields.

Fields

infcx: InferCtxt<'a, 'tcx>typeck_results: MaybeInProgressTables<'a, 'tcx>locals: RefCell<HirIdMap<LocalTy<'tcx>>>fulfillment_cx: RefCell<Box<dyn TraitEngine<'tcx>>>deferred_sized_obligations: RefCell<Vec<(Ty<'tcx>, Span, ObligationCauseCode<'tcx>)>>deferred_call_resolutions: RefCell<DefIdMap<Vec<DeferredCallResolution<'tcx>>>>deferred_cast_checks: RefCell<Vec<CastCheck<'tcx>>>deferred_generator_interiors: RefCell<Vec<(BodyId, Ty<'tcx>, GeneratorKind)>>opaque_types: RefCell<VecMap<OpaqueTypeKey<'tcx>, OpaqueTypeDecl<'tcx>>>opaque_types_vars: RefCell<FxHashMap<Ty<'tcx>, Ty<'tcx>>>

A map from inference variables created from opaque type instantiations (ty::Infer) to the actual opaque type (ty::Opaque). Used during fallback to map unconstrained opaque type inference variables to their corresponding opaque type.

body_id: Option<BodyId>

Implementations

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

Note: Most layout information is completely unstable and may be different between compiler versions and platforms. 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: 984 bytes