pub struct CoroutineInfo<'tcx> {
pub yield_ty: Option<Ty<'tcx>>,
pub resume_ty: Option<Ty<'tcx>>,
pub coroutine_drop: Option<Body<'tcx>>,
pub coroutine_layout: Option<CoroutineLayout<'tcx>>,
pub coroutine_kind: CoroutineKind,
}
Expand description
Additional information carried by a MIR body when it is lowered from a coroutine.
This information is modified as it is lowered during the StateTransform
MIR pass,
so not all fields will be active at a given time. For example, the yield_ty
is
taken out of the field after yields are turned into returns, and the coroutine_drop
body is only populated after the state transform pass.
Fields§
§yield_ty: Option<Ty<'tcx>>
The yield type of the function. This field is removed after the state transform pass.
resume_ty: Option<Ty<'tcx>>
The resume type of the function. This field is removed after the state transform pass.
coroutine_drop: Option<Body<'tcx>>
Coroutine drop glue. This field is populated after the state transform pass.
coroutine_layout: Option<CoroutineLayout<'tcx>>
The layout of a coroutine. This field is populated after the state transform pass.
coroutine_kind: CoroutineKind
If this is a coroutine then record the type of source expression that caused this coroutine to be created.