Enum rustc::ty::TypeVariants
[−]
[src]
pub enum TypeVariants<'tcx> {
TyBool,
TyChar,
TyInt(IntTy),
TyUint(UintTy),
TyFloat(FloatTy),
TyAdt(&'tcx AdtDef, &'tcx Substs<'tcx>),
TyForeign(DefId),
TyStr,
TyArray(Ty<'tcx>, &'tcx Const<'tcx>),
TySlice(Ty<'tcx>),
TyRawPtr(TypeAndMut<'tcx>),
TyRef(Region<'tcx>, TypeAndMut<'tcx>),
TyFnDef(DefId, &'tcx Substs<'tcx>),
TyFnPtr(PolyFnSig<'tcx>),
TyDynamic(Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>, Region<'tcx>),
TyClosure(DefId, ClosureSubsts<'tcx>),
TyGenerator(DefId, ClosureSubsts<'tcx>, GeneratorInterior<'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)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
NB: If you change this, you'll probably want to change the corresponding AST structure in libsyntax/ast.rs as well.
Variants
TyBool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The primitive boolean type. Written as bool.
TyChar🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The primitive character type; holds a Unicode scalar value
(a non-surrogate code point). Written as char.
TyInt(IntTy)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A primitive signed integer type. For example, i32.
TyUint(UintTy)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A primitive unsigned integer type. For example, u32.
TyFloat(FloatTy)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A primitive floating-point type. For example, f64.
TyAdt(&'tcx AdtDef, &'tcx Substs<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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.
TyForeign(DefId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
TyStr🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The pointee of a string slice. Written as str.
TyArray(Ty<'tcx>, &'tcx Const<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
An array with the given length. Written as [T; n].
TySlice(Ty<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The pointee of an array slice. Written as [T].
TyRawPtr(TypeAndMut<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A raw pointer. Written as *mut T or *const T
TyRef(Region<'tcx>, TypeAndMut<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A reference; a pointer with an associated lifetime. Written as
&'a mut T or &'a T.
TyFnDef(DefId, &'tcx Substs<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The anonymous type of a function declaration/definition. Each function has a unique type.
TyFnPtr(PolyFnSig<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A pointer to a function. Written as fn() -> i32.
TyDynamic(Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>, Region<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A trait, defined with trait.
TyClosure(DefId, ClosureSubsts<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The anonymous type of a closure. Used to represent the type of
|a| a.
TyGenerator(DefId, ClosureSubsts<'tcx>, GeneratorInterior<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The anonymous type of a generator. Used to represent the type of
|a| yield a.
TyNever🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The never type !
TyTuple(&'tcx Slice<Ty<'tcx>>, bool)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The projection of an associated type. For example,
<T as Trait<..>>::N.
TyAnon(DefId, &'tcx Substs<'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A type parameter; for example, T in `fn f
TyInfer(InferTy)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A type variable used during type-checking.
TyError🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A placeholder for a type which could not be computed; this is propagated to avoid useless error messages.
Trait Implementations
impl<'gcx> HashStable<StableHashingContext<'gcx>> for TypeVariants<'gcx>[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)[src]
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Clone for TypeVariants<'tcx>[src]
fn clone(&self) -> TypeVariants<'tcx>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<'tcx> PartialEq for TypeVariants<'tcx>[src]
fn eq(&self, __arg_0: &TypeVariants<'tcx>) -> bool[src]
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[src]
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)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl<'tcx> Debug for TypeVariants<'tcx>[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<'tcx> Encodable for TypeVariants<'tcx>[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Decodable for TypeVariants<'tcx>[src]
fn decode<__D: Decoder>(
__arg_0: &mut __D
) -> Result<TypeVariants<'tcx>, __D::Error>[src]
__arg_0: &mut __D
) -> Result<TypeVariants<'tcx>, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Print for TypeVariants<'tcx>[src]
fn print<F: Write>(&self, f: &mut F, cx: &mut PrintContext) -> Result[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn print_to_string(&self, cx: &mut PrintContext) -> String[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn print_display<F: Write>(&self, f: &mut F, cx: &mut PrintContext) -> Result[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn print_display_to_string(&self, cx: &mut PrintContext) -> String[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn print_debug<F: Write>(&self, f: &mut F, cx: &mut PrintContext) -> Result[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn print_debug_to_string(&self, cx: &mut PrintContext) -> String[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?