Struct rustc_typeck::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.

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

Trait Implementations

impl<'tcx> RegionEscape for TypeScheme<'tcx>

fn has_regions_escaping_depth(&self, depth: u32) -> bool

fn has_escaping_regions(&self) -> bool

impl<'tcx> Repr<'tcx> for TypeScheme<'tcx>

fn repr(&self, tcx: &ctxt<'tcx>) -> String

Derived Implementations

impl<'tcx> Debug for TypeScheme<'tcx>

fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>

impl<'tcx> Clone for TypeScheme<'tcx>

fn clone(&self) -> TypeScheme<'tcx>

fn clone_from(&mut self, source: &Self)