Module rustc_middle::ty::sty[−][src]

Expand description

This module contains TyKind and its major components.

Structs

Binder

Binder is a binder for higher-ranked lifetimes or types. It is part of the compiler’s representation for things like for<'a> Fn(&'a isize) (which would be represented by the type PolyTraitRef == Binder<'tcx, TraitRef>). Note that when we instantiate, erase, or otherwise “discharge” these bound vars, we change the type from Binder<'tcx, T> to just T (see e.g., liberate_late_bound_regions).

BoundRegion
BoundTy
BoundVar
ClosureSubsts

A closure can be modeled as a struct that looks like:

ClosureSubstsParts

Struct returned by split().

ConstVid

A const variable ID.

EarlyBoundRegion
ExistentialProjection

A ProjectionPredicate for an ExistentialTraitRef.

ExistentialTraitRef

An existential reference to a trait, where Self is erased. For example, the trait object Trait<'a, 'b, X, Y> is:

FnSig

Signature of a function type, which we have arbitrarily decided to use to refer to the input/output types.

FreeRegion

A “free” region fr can be interpreted as “some region at least as big as the scope fr.scope”.

GenSig
GeneratorSubsts

Similar to ClosureSubsts; see the above documentation for more.

GeneratorSubstsParts
ParamConst
ParamTy
ProjectionTy

Represents the projection of an associated type. In explicit UFCS form this would be written <T as Trait<..>>::N.

RegionVid

A region (lifetime) variable ID.

TraitRef

A complete reference to a trait. These take numerous guises in syntax, but perhaps the most recognizable form is in a where-clause:

TypeAndMut

Enums

BoundRegionKind
BoundTyKind
BoundVariableKind
ExistentialPredicate
RegionKind

Representation of regions. Note that the NLL checker uses a distinct representation of regions. For this reason, it internally replaces all the regions with inference variables – the index of the variable is then used to index into internal NLL data structures. See rustc_mir::borrow_check module for more information.

TyKind

Defines the kinds of types.

UpvarSubsts
VarianceDiagInfo

Extra information about why we ended up with a particular variance. This is only used to add more information to error messages, and has no effect on soundness. While choosing the ‘wrong’ VarianceDiagInfo may lead to confusing notes in error messages, it will never cause a miscompilation or unsoundness.

VarianceDiagMutKind

Type Definitions

CanonicalPolyFnSig
PolyExistentialProjection
PolyExistentialTraitRef
PolyFnSig
PolyGenSig
PolyTraitRef
Region