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>),
TyGeneratorWitness(Binder<&'tcx Slice<Ty<'tcx>>>),
TyNever,
TyTuple(&'tcx Slice<Ty<'tcx>>),
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.
TyGeneratorWitness(Binder<&'tcx Slice<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?
A type representin the types stored inside a generator. This should only appear in GeneratorInteriors.
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>>)🔬 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).
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<'a, 'gcx> HashStable<StableHashingContext<'a>> for TypeVariants<'gcx>[src]
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for TypeVariants<'gcx>fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
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]
impl<'tcx> Clone for TypeVariants<'tcx>fn clone(&self) -> 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[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<'tcx> PartialEq for TypeVariants<'tcx>[src]
impl<'tcx> PartialEq for TypeVariants<'tcx>fn eq(&self, __arg_0: &TypeVariants<'tcx>) -> bool[src]
fn eq(&self, __arg_0: &TypeVariants<'tcx>) -> boolThis 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]
fn ne(&self, __arg_0: &TypeVariants<'tcx>) -> boolThis method tests for !=.
impl<'tcx> Eq for TypeVariants<'tcx>[src]
impl<'tcx> Eq for TypeVariants<'tcx>impl<'tcx> Hash for TypeVariants<'tcx>[src]
impl<'tcx> Hash for TypeVariants<'tcx>fn hash<__H: Hasher>(&self, __arg_0: &mut __H)[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<'tcx> Debug for TypeVariants<'tcx>[src]
impl<'tcx> Debug for TypeVariants<'tcx>fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
fn fmt(&self, __arg_0: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'tcx> Encodable for TypeVariants<'tcx>[src]
impl<'tcx> Encodable for TypeVariants<'tcx>fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::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> Decodable for TypeVariants<'tcx>[src]
impl<'tcx> Decodable for TypeVariants<'tcx>fn decode<__D: Decoder>(
__arg_0: &mut __D
) -> Result<TypeVariants<'tcx>, __D::Error>[src]
fn decode<__D: Decoder>(
__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]
impl<'tcx> Print for TypeVariants<'tcx>fn print<F: Write>(&self, f: &mut F, cx: &mut PrintContext) -> Result[src]
fn print<F: Write>(&self, f: &mut F, cx: &mut PrintContext) -> Result🔬 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]
fn print_to_string(&self, cx: &mut PrintContext) -> String🔬 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]
fn print_display<F: Write>(&self, f: &mut F, cx: &mut PrintContext) -> Result🔬 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]
fn print_display_to_string(&self, cx: &mut PrintContext) -> String🔬 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]
fn print_debug<F: Write>(&self, f: &mut F, cx: &mut PrintContext) -> Result🔬 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]
fn print_debug_to_string(&self, cx: &mut PrintContext) -> String🔬 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> Display for TypeVariants<'tcx>[src]
impl<'tcx> Display for TypeVariants<'tcx>Auto Trait Implementations
impl<'tcx> !Send for TypeVariants<'tcx>
impl<'tcx> !Send for TypeVariants<'tcx>impl<'tcx> !Sync for TypeVariants<'tcx>
impl<'tcx> !Sync for TypeVariants<'tcx>