Enum rustc::ty::TypeVariants
[−]
[src]
pub enum TypeVariants<'tcx> { TyBool, TyChar, TyInt(IntTy), TyUint(UintTy), TyFloat(FloatTy), TyAdt(&'tcx AdtDef, &'tcx Substs<'tcx>), TyStr, TyArray(Ty<'tcx>, usize), TySlice(Ty<'tcx>), TyRawPtr(TypeAndMut<'tcx>), TyRef(&'tcx Region, TypeAndMut<'tcx>), TyFnDef(DefId, &'tcx Substs<'tcx>, PolyFnSig<'tcx>), TyFnPtr(PolyFnSig<'tcx>), TyDynamic(Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>, &'tcx Region), TyClosure(DefId, ClosureSubsts<'tcx>), TyNever, TyTuple(&'tcx Slice<Ty<'tcx>>, bool), TyProjection(ProjectionTy<'tcx>), TyAnon(DefId, &'tcx Substs<'tcx>), TyParam(ParamTy), TyInfer(InferTy), TyError, }
rustc_private
)Variants
TyBool
rustc_private
)The primitive boolean type. Written as bool
.
TyChar
rustc_private
)The primitive character type; holds a Unicode scalar value
(a non-surrogate code point). Written as char
.
TyInt(IntTy)
rustc_private
)A primitive signed integer type. For example, i32
.
TyUint(UintTy)
rustc_private
)A primitive unsigned integer type. For example, u32
.
TyFloat(FloatTy)
rustc_private
)A primitive floating-point type. For example, f64
.
TyAdt(&'tcx AdtDef, &'tcx Substs<'tcx>)
rustc_private
)Structures, enumerations and unions.
Substs here, possibly against intuition, may contain TyParam
s.
That is, even after substitution it is possible that there are type
variables. This happens when the TyAdt
corresponds to an ADT
definition and not a concrete use of it.
TyStr
rustc_private
)The pointee of a string slice. Written as str
.
TyArray(Ty<'tcx>, usize)
rustc_private
)An array with the given length. Written as [T; n]
.
TySlice(Ty<'tcx>)
rustc_private
)The pointee of an array slice. Written as [T]
.
TyRawPtr(TypeAndMut<'tcx>)
rustc_private
)A raw pointer. Written as *mut T
or *const T
TyRef(&'tcx Region, TypeAndMut<'tcx>)
rustc_private
)A reference; a pointer with an associated lifetime. Written as
&'a mut T
or &'a T
.
TyFnDef(DefId, &'tcx Substs<'tcx>, PolyFnSig<'tcx>)
rustc_private
)The anonymous type of a function declaration/definition. Each function has a unique type.
TyFnPtr(PolyFnSig<'tcx>)
rustc_private
)A pointer to a function. Written as fn() -> i32
.
FIXME: This is currently also used to represent the callee of a method;
see ty::MethodCallee etc.
TyDynamic(Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>, &'tcx Region)
rustc_private
)A trait, defined with trait
.
TyClosure(DefId, ClosureSubsts<'tcx>)
rustc_private
)The anonymous type of a closure. Used to represent the type of
|a| a
.
TyNever
rustc_private
)The never type !
TyTuple(&'tcx Slice<Ty<'tcx>>, bool)
rustc_private
)A tuple type. For example, (i32, bool)
.
The bool indicates whether this is a unit tuple and was created by
defaulting a diverging type variable with feature(never_type) disabled.
It's only purpose is for raising future-compatibility warnings for when
diverging type variables start defaulting to ! instead of ().
TyProjection(ProjectionTy<'tcx>)
rustc_private
)The projection of an associated type. For example,
<T as Trait<..>>::N
.
TyAnon(DefId, &'tcx Substs<'tcx>)
rustc_private
)Anonymized (impl Trait
) type found in a return type.
The DefId comes from the impl Trait
ast::Ty node, and the
substitutions are for the generics of the function in question.
After typeck, the concrete type can be found in the types
map.
TyParam(ParamTy)
rustc_private
)A type parameter; for example, T
in `fn f
TyInfer(InferTy)
rustc_private
)A type variable used during type-checking.
TyError
rustc_private
)A placeholder for a type which could not be computed; this is propagated to avoid useless error messages.
Trait Implementations
impl<'tcx> Clone for TypeVariants<'tcx>
[src]
fn clone(&self) -> TypeVariants<'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
impl<'tcx> PartialEq for TypeVariants<'tcx>
[src]
fn eq(&self, __arg_0: &TypeVariants<'tcx>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TypeVariants<'tcx>) -> bool
This method tests for !=
.
impl<'tcx> Eq for TypeVariants<'tcx>
[src]
impl<'tcx> Hash for TypeVariants<'tcx>
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<'tcx> Debug for TypeVariants<'tcx>
[src]
impl<'tcx> Encodable for TypeVariants<'tcx>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx> Decodable for TypeVariants<'tcx>
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D)
-> Result<TypeVariants<'tcx>, __D::Error>
-> Result<TypeVariants<'tcx>, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io