Struct rustc::ty::TypeScheme
[−]
[src]
pub struct TypeScheme<'tcx> { pub generics: Generics<'tcx>, pub ty: Ty<'tcx>, }
rustc_private
)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: Generics<'tcx>
rustc_private
)ty: Ty<'tcx>
rustc_private
)Trait Implementations
impl<'tcx> TypeFoldable<'tcx> for TypeScheme<'tcx>
[src]
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
fn has_regions_escaping_depth(&self, depth: u32) -> bool
fn has_escaping_regions(&self) -> bool
fn has_type_flags(&self, flags: TypeFlags) -> bool
fn has_projection_types(&self) -> bool
fn references_error(&self) -> bool
fn has_param_types(&self) -> bool
fn has_self_ty(&self) -> bool
fn has_infer_types(&self) -> bool
fn needs_infer(&self) -> bool
fn needs_subst(&self) -> bool
fn has_closure_types(&self) -> bool
fn has_erasable_regions(&self) -> bool
fn is_global(&self) -> bool
Indicates whether this value references only 'global' types/lifetimes that are the same regardless of what fn we are in. This is used for caching. Errs on the side of returning false. Read more
Derived Implementations
impl<'tcx> Debug for TypeScheme<'tcx>
[src]
impl<'tcx> Clone for TypeScheme<'tcx>
[src]
fn clone(&self) -> TypeScheme<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more