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

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

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

impl<'_, 'tcx> Inherited<'_, 'tcx>[src]

pub fn build(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> InheritedBuilder<'tcx>[src]

impl<'a, 'tcx> Inherited<'a, 'tcx>[src]

pub(in check) fn new(
    infcx: InferCtxt<'a, 'tcx>,
    def_id: LocalDefId
) -> Self
[src]

pub(in check) fn register_predicate(
    &self,
    obligation: PredicateObligation<'tcx>
)
[src]

pub(in check) fn register_predicates<I>(
    &self,
    obligations: I
) where
    I: IntoIterator<Item = PredicateObligation<'tcx>>, 
[src]

pub(in check) fn register_infer_ok_obligations<T>(
    &self,
    infer_ok: InferOk<'tcx, T>
) -> T
[src]

pub(in check) fn normalize_associated_types_in<T>(
    &self,
    span: Span,
    body_id: HirId,
    param_env: ParamEnv<'tcx>,
    value: T
) -> T where
    T: TypeFoldable<'tcx>, 
[src]

Trait Implementations

impl<'a, 'tcx> Deref for Inherited<'a, 'tcx>[src]

type Target = InferCtxt<'a, 'tcx>

The resulting type after dereferencing.

Auto Trait Implementations

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

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

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

impl<'a, 'tcx> Unpin for Inherited<'a, 'tcx> where
    'tcx: 'a, 

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

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]