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

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<TraitRef>). Note that when we instantiate, erase, or otherwise "discharge" these bound vars, we change the type from Binder<T> to just T (see e.g., liberate_late_bound_regions).

BoundTy
BoundVar
ClosureSubsts

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

ConstVid
DebruijnIndex

A De Bruijn index is a standard means of representing regions (and perhaps later types) in a higher-ranked setting. In particular, imagine a type like this:

DelaySpanBugEmitted

A type that is not publicly constructable. This prevents people from making TyKind::Error except through tcx.err*().

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:

FloatVid
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.

IntVid
ParamConst
ParamTy
ProjectionTy

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

RegionVid
SplitClosureSubsts

Struct returned by split(). Note that these are subslices of the parent slice and not canonical substs themselves.

SplitGeneratorSubsts
TraitRef

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

TyVid
TypeAndMut

Enums

BoundRegion
BoundTyKind
ExistentialPredicate
InferTy
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

N.B., if you change this, you'll probably want to change the corresponding AST structure in librustc_ast/ast.rs as well.

UpvarSubsts

Constants

INNERMOST

Type Definitions

CanonicalPolyFnSig
PolyExistentialProjection
PolyExistentialTraitRef
PolyFnSig
PolyGenSig
PolyTraitRef
Region