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 RegionTypeAndMut<'tcx>),
    TyFnDef(DefId, &'tcx Substs<'tcx>, PolyFnSig<'tcx>),
    TyFnPtr(PolyFnSig<'tcx>),
    TyDynamic(Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>, &'tcx Region),
    TyClosure(DefIdClosureSubsts<'tcx>),
    TyNever,
    TyTuple(&'tcx Slice<Ty<'tcx>>, bool),
    TyProjection(ProjectionTy<'tcx>),
    TyAnon(DefId, &'tcx Substs<'tcx>),
    TyParam(ParamTy),
    TyInfer(InferTy),
    TyError,
}
🔬 This is a nightly-only experimental API. (rustc_private)

Variants

🔬 This is a nightly-only experimental API. (rustc_private)

The primitive boolean type. Written as bool.

🔬 This is a nightly-only experimental API. (rustc_private)

The primitive character type; holds a Unicode scalar value (a non-surrogate code point). Written as char.

🔬 This is a nightly-only experimental API. (rustc_private)

A primitive signed integer type. For example, i32.

🔬 This is a nightly-only experimental API. (rustc_private)

A primitive unsigned integer type. For example, u32.

🔬 This is a nightly-only experimental API. (rustc_private)

A primitive floating-point type. For example, f64.

🔬 This is a nightly-only experimental API. (rustc_private)

Structures, enumerations and unions.

Substs here, possibly against intuition, may contain TyParams. 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.

🔬 This is a nightly-only experimental API. (rustc_private)

The pointee of a string slice. Written as str.

🔬 This is a nightly-only experimental API. (rustc_private)

An array with the given length. Written as [T; n].

🔬 This is a nightly-only experimental API. (rustc_private)

The pointee of an array slice. Written as [T].

🔬 This is a nightly-only experimental API. (rustc_private)

A raw pointer. Written as *mut T or *const T

🔬 This is a nightly-only experimental API. (rustc_private)

A reference; a pointer with an associated lifetime. Written as &'a mut T or &'a T.

🔬 This is a nightly-only experimental API. (rustc_private)

The anonymous type of a function declaration/definition. Each function has a unique type.

🔬 This is a nightly-only experimental API. (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.

🔬 This is a nightly-only experimental API. (rustc_private)

A trait, defined with trait.

🔬 This is a nightly-only experimental API. (rustc_private)

The anonymous type of a closure. Used to represent the type of |a| a.

🔬 This is a nightly-only experimental API. (rustc_private)

The never type !

🔬 This is a nightly-only experimental API. (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 ().

🔬 This is a nightly-only experimental API. (rustc_private)

The projection of an associated type. For example, <T as Trait<..>>::N.

🔬 This is a nightly-only experimental API. (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.

🔬 This is a nightly-only experimental API. (rustc_private)

A type parameter; for example, T in `fn f(x: T) {}

🔬 This is a nightly-only experimental API. (rustc_private)

A type variable used during type-checking.

🔬 This is a nightly-only experimental API. (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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'tcx> PartialEq for TypeVariants<'tcx>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'tcx> Eq for TypeVariants<'tcx>
[src]

impl<'tcx> Hash for TypeVariants<'tcx>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl<'tcx> Debug for TypeVariants<'tcx>
[src]

Formats the value using the given formatter.

impl<'tcx> Encodable for TypeVariants<'tcx>
[src]

🔬 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]

🔬 This is a nightly-only experimental API. (rustc_private)

deprecated in favor of rustc-serialize on crates.io

impl<'tcx> Display for TypeVariants<'tcx>
[src]

Formats the value using the given formatter. Read more