pub struct Inherited<'a, 'tcx> {
pub(super) infcx: InferCtxt<'a, 'tcx>,
pub(super) typeck_results: &'a RefCell<TypeckResults<'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<LocalDefIdMap<Vec<DeferredCallResolution<'tcx>>>>,
pub(super) deferred_cast_checks: RefCell<Vec<CastCheck<'tcx>>>,
pub(super) deferred_transmute_checks: RefCell<Vec<(Ty<'tcx>, Ty<'tcx>, Span)>>,
pub(super) deferred_asm_checks: RefCell<Vec<(&'tcx InlineAsm<'tcx>, HirId)>>,
pub(super) deferred_generator_interiors: RefCell<Vec<(BodyId, Ty<'tcx>, GeneratorKind)>>,
pub(super) body_id: Option<BodyId>,
pub(super) diverging_type_vars: RefCell<FxHashSet<Ty<'tcx>>>,
}
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: &'a RefCell<TypeckResults<'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<LocalDefIdMap<Vec<DeferredCallResolution<'tcx>>>>
deferred_cast_checks: RefCell<Vec<CastCheck<'tcx>>>
deferred_transmute_checks: RefCell<Vec<(Ty<'tcx>, Ty<'tcx>, Span)>>
deferred_asm_checks: RefCell<Vec<(&'tcx InlineAsm<'tcx>, HirId)>>
deferred_generator_interiors: RefCell<Vec<(BodyId, Ty<'tcx>, GeneratorKind)>>
body_id: Option<BodyId>
diverging_type_vars: RefCell<FxHashSet<Ty<'tcx>>>
Whenever we introduce an adjustment from !
into a type variable,
we record that type variable here. This is later used to inform
fallback. See the fallback
module for details.
Implementations
sourceimpl<'tcx> Inherited<'_, 'tcx>
impl<'tcx> Inherited<'_, 'tcx>
pub fn build(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> InheritedBuilder<'tcx>
sourceimpl<'a, 'tcx> Inherited<'a, 'tcx>
impl<'a, 'tcx> Inherited<'a, 'tcx>
fn new(infcx: InferCtxt<'a, 'tcx>, def_id: LocalDefId) -> Self
pub(super) fn register_predicate(&self, obligation: PredicateObligation<'tcx>)
pub(super) fn register_predicates<I>(&self, obligations: I)where
I: IntoIterator<Item = PredicateObligation<'tcx>>,
pub(super) fn register_infer_ok_obligations<T>(
&self,
infer_ok: InferOk<'tcx, T>
) -> T
pub(super) fn normalize_associated_types_in<T>(
&self,
span: Span,
body_id: HirId,
param_env: ParamEnv<'tcx>,
value: T
) -> Twhere
T: TypeFoldable<'tcx>,
pub(super) fn normalize_associated_types_in_with_cause<T>(
&self,
cause: ObligationCause<'tcx>,
param_env: ParamEnv<'tcx>,
value: T
) -> Twhere
T: TypeFoldable<'tcx>,
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
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: 1080 bytes