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) constness: Constness,
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)>>constness: ConstnessReports whether this is in a const context.
body_id: Option<BodyId>Implementations
pub(super) fn with_constness(
infcx: InferCtxt<'a, 'tcx>,
def_id: LocalDefId,
constness: Constness
) -> Self
pub(super) fn register_predicates<I>(&self, obligations: I) where
I: IntoIterator<Item = PredicateObligation<'tcx>>,
pub(super) fn normalize_associated_types_in<T>(
&self,
span: Span,
body_id: HirId,
param_env: ParamEnv<'tcx>,
value: T
) -> T where
T: TypeFoldable<'tcx>,
pub(super) fn normalize_associated_types_in_with_cause<T>(
&self,
cause: ObligationCause<'tcx>,
param_env: ParamEnv<'tcx>,
value: T
) -> T where
T: TypeFoldable<'tcx>,
Trait Implementations
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for Inherited<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for Inherited<'a, 'tcx>
Blanket Implementations
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