Struct rustc_middle::ty::GeneratorSubsts [−][src]
pub struct GeneratorSubsts<'tcx> {
pub substs: SubstsRef<'tcx>,
}Expand description
Similar to ClosureSubsts; see the above documentation for more.
Fields
substs: SubstsRef<'tcx>Implementations
impl<'tcx> GeneratorSubsts<'tcx>[src]
impl<'tcx> GeneratorSubsts<'tcx>[src]pub fn new(
tcx: TyCtxt<'tcx>,
parts: GeneratorSubstsParts<'tcx, Ty<'tcx>>
) -> GeneratorSubsts<'tcx>[src]
pub fn new(
tcx: TyCtxt<'tcx>,
parts: GeneratorSubstsParts<'tcx, Ty<'tcx>>
) -> GeneratorSubsts<'tcx>[src]Construct GeneratorSubsts from GeneratorSubstsParts, containing Substs
for the generator parent, alongside additional generator-specific components.
fn split(self) -> GeneratorSubstsParts<'tcx, GenericArg<'tcx>>[src]
fn split(self) -> GeneratorSubstsParts<'tcx, GenericArg<'tcx>>[src]Divides the generator substs into their respective components.
The ordering assumed here must match that used by GeneratorSubsts::new above.
pub fn is_valid(self) -> bool[src]
pub fn is_valid(self) -> bool[src]Returns true only if enough of the synthetic types are known to
allow using all of the methods on GeneratorSubsts without panicking.
Used primarily by ty::print::pretty to be able to handle generator
types that haven’t had their synthetic types substituted in.
pub fn parent_substs(self) -> &'tcx [GenericArg<'tcx>]ⓘ[src]
pub fn parent_substs(self) -> &'tcx [GenericArg<'tcx>]ⓘ[src]Returns the substitutions of the generator’s parent.
pub fn witness(self) -> Ty<'tcx>[src]
pub fn witness(self) -> Ty<'tcx>[src]This describes the types that can be contained in a generator. It will be a type variable initially and unified in the last stages of typeck of a body. It contains a tuple of all the types that could end up on a generator frame. The state transformation MIR pass may only produce layouts which mention types in this tuple. Upvars are not counted here.
pub fn upvar_tys(self) -> impl Iterator<Item = Ty<'tcx>> + 'tcx[src]
pub fn upvar_tys(self) -> impl Iterator<Item = Ty<'tcx>> + 'tcx[src]Returns an iterator over the list of types of captured paths by the generator. In case there was a type error in figuring out the types of the captured path, an empty iterator is returned.
pub fn tupled_upvars_ty(self) -> Ty<'tcx>[src]
pub fn tupled_upvars_ty(self) -> Ty<'tcx>[src]Returns the tuple type representing the upvars for this generator.
pub fn resume_ty(self) -> Ty<'tcx>[src]
pub fn resume_ty(self) -> Ty<'tcx>[src]Returns the type representing the resume type of the generator.
pub fn yield_ty(self) -> Ty<'tcx>[src]
pub fn yield_ty(self) -> Ty<'tcx>[src]Returns the type representing the yield type of the generator.
pub fn return_ty(self) -> Ty<'tcx>[src]
pub fn return_ty(self) -> Ty<'tcx>[src]Returns the type representing the return type of the generator.
pub fn poly_sig(self) -> PolyGenSig<'tcx>[src]
pub fn poly_sig(self) -> PolyGenSig<'tcx>[src]Returns the “generator signature”, which consists of its yield and return types.
N.B., some bits of the code prefers to see this wrapped in a binder, but it never contains bound regions. Probably this function should be removed.
impl<'tcx> GeneratorSubsts<'tcx>[src]
impl<'tcx> GeneratorSubsts<'tcx>[src]const UNRESUMED_NAME: &'static str[src]
const RETURNED_NAME: &'static str[src]
const POISONED_NAME: &'static str[src]
pub fn variant_range(
&self,
def_id: DefId,
tcx: TyCtxt<'tcx>
) -> Range<VariantIdx>[src]
pub fn variant_range(
&self,
def_id: DefId,
tcx: TyCtxt<'tcx>
) -> Range<VariantIdx>[src]The valid variant indices of this generator.
pub fn discriminant_for_variant(
&self,
def_id: DefId,
tcx: TyCtxt<'tcx>,
variant_index: VariantIdx
) -> Discr<'tcx>[src]
pub fn discriminant_for_variant(
&self,
def_id: DefId,
tcx: TyCtxt<'tcx>,
variant_index: VariantIdx
) -> Discr<'tcx>[src]The discriminant for the given variant. Panics if the variant_index is
out of range.
pub fn discriminants(
self,
def_id: DefId,
tcx: TyCtxt<'tcx>
) -> impl Iterator<Item = (VariantIdx, Discr<'tcx>)> + Captures<'tcx>[src]
pub fn discriminants(
self,
def_id: DefId,
tcx: TyCtxt<'tcx>
) -> impl Iterator<Item = (VariantIdx, Discr<'tcx>)> + Captures<'tcx>[src]The set of all discriminants for the generator, enumerated with their variant indices.
pub fn variant_name(v: VariantIdx) -> Cow<'static, str>[src]
pub fn variant_name(v: VariantIdx) -> Cow<'static, str>[src]Calls f with a reference to the name of the enumerator for the given
variant v.
pub fn discr_ty(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>[src]
pub fn discr_ty(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>[src]The type of the state discriminant used in the generator type.
pub fn state_tys(
self,
def_id: DefId,
tcx: TyCtxt<'tcx>
) -> impl Iterator<Item = impl Iterator<Item = Ty<'tcx>> + Captures<'tcx>>[src]
pub fn state_tys(
self,
def_id: DefId,
tcx: TyCtxt<'tcx>
) -> impl Iterator<Item = impl Iterator<Item = Ty<'tcx>> + Captures<'tcx>>[src]This returns the types of the MIR locals which had to be stored across suspension points. It is calculated in rustc_mir::transform::generator::StateTransform. All the types here must be in the tuple in GeneratorInterior.
The locals are grouped by their variant number. Note that some locals may be repeated in multiple variants.
pub fn prefix_tys(self) -> impl Iterator<Item = Ty<'tcx>>[src]
pub fn prefix_tys(self) -> impl Iterator<Item = Ty<'tcx>>[src]This is the types of the fields of a generator which are not stored in a variant.
Trait Implementations
impl<'tcx> Clone for GeneratorSubsts<'tcx>[src]
impl<'tcx> Clone for GeneratorSubsts<'tcx>[src]fn clone(&self) -> GeneratorSubsts<'tcx>[src]
fn clone(&self) -> GeneratorSubsts<'tcx>[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl<'tcx> Debug for GeneratorSubsts<'tcx>[src]
impl<'tcx> Debug for GeneratorSubsts<'tcx>[src]impl<'a, 'tcx> Lift<'tcx> for GeneratorSubsts<'a>[src]
impl<'a, 'tcx> Lift<'tcx> for GeneratorSubsts<'a>[src]type Lifted = GeneratorSubsts<'tcx>
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted>[src]
impl<'tcx> Relate<'tcx> for GeneratorSubsts<'tcx>[src]
impl<'tcx> Relate<'tcx> for GeneratorSubsts<'tcx>[src]fn relate<R: TypeRelation<'tcx>>(
relation: &mut R,
a: GeneratorSubsts<'tcx>,
b: GeneratorSubsts<'tcx>
) -> RelateResult<'tcx, GeneratorSubsts<'tcx>>[src]
relation: &mut R,
a: GeneratorSubsts<'tcx>,
b: GeneratorSubsts<'tcx>
) -> RelateResult<'tcx, GeneratorSubsts<'tcx>>
impl<'tcx> TypeFoldable<'tcx> for GeneratorSubsts<'tcx>[src]
impl<'tcx> TypeFoldable<'tcx> for GeneratorSubsts<'tcx>[src]fn super_fold_with<__F: TypeFolder<'tcx>>(self, __folder: &mut __F) -> Self[src]
fn super_visit_with<__F: TypeVisitor<'tcx>>(
&self,
__folder: &mut __F
) -> ControlFlow<__F::BreakTy>[src]
&self,
__folder: &mut __F
) -> ControlFlow<__F::BreakTy>
fn fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self[src]
fn visit_with<V: TypeVisitor<'tcx>>(
&self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>[src]
&self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>
fn has_vars_bound_at_or_above(&self, binder: DebruijnIndex) -> bool[src]
fn has_vars_bound_at_or_above(&self, binder: DebruijnIndex) -> bool[src]Returns true if self has any late-bound regions that are either
bound by binder or bound by some binder outside of binder.
If binder is ty::INNERMOST, this indicates whether
there are any late-bound regions that appear free. Read more
fn has_vars_bound_above(&self, binder: DebruijnIndex) -> bool[src]
fn has_vars_bound_above(&self, binder: DebruijnIndex) -> bool[src]Returns true if this self has any regions that escape binder (and
hence are not bound by it). Read more
fn has_escaping_bound_vars(&self) -> bool[src]
fn has_type_flags(&self, flags: TypeFlags) -> bool[src]
fn has_projections(&self) -> bool[src]
fn has_opaque_types(&self) -> bool[src]
fn references_error(&self) -> bool[src]
fn has_param_types_or_consts(&self) -> bool[src]
fn has_infer_regions(&self) -> bool[src]
fn has_infer_types(&self) -> bool[src]
fn has_infer_types_or_consts(&self) -> bool[src]
fn needs_infer(&self) -> bool[src]
fn has_placeholders(&self) -> bool[src]
fn needs_subst(&self) -> bool[src]
fn has_free_regions(&self) -> bool[src]
fn has_free_regions(&self) -> bool[src]“Free” regions in this context means that it has any region that is not (a) erased or (b) late-bound. Read more
fn has_erased_regions(&self) -> bool[src]
fn has_erasable_regions(&self) -> bool[src]
fn has_erasable_regions(&self) -> bool[src]True if there are any un-erased free regions.
fn is_global(&self) -> bool[src]
fn is_global(&self) -> bool[src]Indicates whether this value references only ‘global’ generic parameters that are the same regardless of what fn we are in. This is used for caching. Read more
fn has_late_bound_regions(&self) -> bool[src]
fn has_late_bound_regions(&self) -> bool[src]True if there are any late-bound regions
fn still_further_specializable(&self) -> bool[src]
fn still_further_specializable(&self) -> bool[src]Indicates whether this value still has parameters/placeholders/inference variables
which could be replaced later, in a way that would change the results of impl
specialization. Read more
impl<'tcx> Copy for GeneratorSubsts<'tcx>[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for GeneratorSubsts<'tcx>
impl<'tcx> !Send for GeneratorSubsts<'tcx>
impl<'tcx> !Sync for GeneratorSubsts<'tcx>
impl<'tcx> Unpin for GeneratorSubsts<'tcx>
impl<'tcx> !UnwindSafe for GeneratorSubsts<'tcx>
Blanket Implementations
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]pub fn allocate_on(Self, &'a Arena<'tcx>) -> &'a mut T[src]
pub fn allocate_from_iter(
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘ[src]
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘ
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> MaybeResult<T> for T[src]
impl<T> MaybeResult<T> for T[src]impl<'tcx, T> Subst<'tcx> for T where
T: TypeFoldable<'tcx>, [src]
impl<'tcx, T> Subst<'tcx> for T where
T: TypeFoldable<'tcx>, [src]pub fn subst_spanned(Self, TyCtxt<'tcx>, &[GenericArg<'tcx>], Option<Span>) -> T[src]
fn subst(self, tcx: TyCtxt<'tcx>, substs: &[GenericArg<'tcx>]) -> Self[src]
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]
fn with_const(self) -> ConstnessAnd<Self>[src]
fn without_const(self) -> ConstnessAnd<Self>[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,