Struct rustc_middle::ty::sty::CoroutineClosureArgsParts
source · pub struct CoroutineClosureArgsParts<'tcx> {
pub parent_args: &'tcx [GenericArg<'tcx>],
pub closure_kind_ty: Ty<'tcx>,
pub signature_parts_ty: Ty<'tcx>,
pub tupled_upvars_ty: Ty<'tcx>,
pub coroutine_captures_by_ref_ty: Ty<'tcx>,
pub coroutine_witness_ty: Ty<'tcx>,
}
Expand description
See docs for explanation of how each argument is used.
See CoroutineClosureSignature
for how these arguments are put together
to make a callable FnSig
suitable for typeck and borrowck.
Fields§
§parent_args: &'tcx [GenericArg<'tcx>]
This is the args of the typeck root.
closure_kind_ty: Ty<'tcx>
Represents the maximum calling capability of the closure.
signature_parts_ty: Ty<'tcx>
Represents all of the relevant parts of the coroutine returned by this
coroutine-closure. This signature parts type will have the general
shape of fn(tupled_inputs, resume_ty) -> (return_ty, yield_ty)
, where
resume_ty
, return_ty
, and yield_ty
are the respective types for the
coroutine returned by the coroutine-closure.
Use coroutine_closure_sig
to break up this type rather than using it
yourself.
tupled_upvars_ty: Ty<'tcx>
The upvars captured by the closure. Remains an inference variable until the upvar analysis, which happens late in HIR typeck.
coroutine_captures_by_ref_ty: Ty<'tcx>
a function pointer that has the shape for<'env> fn() -> (&'env T, ...)
.
This allows us to represent the binder of the self-captures of the closure.
For example, if the coroutine returned by the closure borrows String
from the closure’s upvars, this will be for<'env> fn() -> (&'env String,)
,
while the tupled_upvars_ty
, representing the by-move version of the same
captures, will be (String,)
.
coroutine_witness_ty: Ty<'tcx>
Witness type returned by the generator produced by this coroutine-closure.
Auto Trait Implementations§
impl<'tcx> DynSend for CoroutineClosureArgsParts<'tcx>
impl<'tcx> DynSync for CoroutineClosureArgsParts<'tcx>
impl<'tcx> Freeze for CoroutineClosureArgsParts<'tcx>
impl<'tcx> !RefUnwindSafe for CoroutineClosureArgsParts<'tcx>
impl<'tcx> Send for CoroutineClosureArgsParts<'tcx>
impl<'tcx> Sync for CoroutineClosureArgsParts<'tcx>
impl<'tcx> Unpin for CoroutineClosureArgsParts<'tcx>
impl<'tcx> !UnwindSafe for CoroutineClosureArgsParts<'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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: 56 bytes