Struct rustc_trans::middle::ty::TypeSchemeUnstable
[-] [+]
[src]
pub struct TypeScheme<'tcx> { pub generics: Generics<'tcx>, pub ty: &'tcx TyS<'tcx>, }
A "type scheme", in ML terminology, is a type combined with some set of generic types that the type is, well, generic over. In Rust terms, it is the "type" of a fn item or struct -- this type will include various generic parameters that must be substituted when the item/struct is referenced. That is called converting the type scheme to a monotype.
generics
: the set of type parameters and their boundsty
: the base types, which may reference the parameters defined ingenerics
Note that TypeSchemes are also sometimes called "polytypes" (and
in fact this struct used to carry that name, so you may find some
stray references in a comment or something). We try to reserve the
"poly" prefix to refer to higher-ranked things, as in
PolyTraitRef
.
Note that each item also comes with predicates, see
lookup_predicates
.
Fields
generics | |
ty |