Enum rustc::ty::sty::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>, Ty<'tcx>, Mutability), TyFnDef(DefId, &'tcx Substs<'tcx>), TyFnPtr(PolyFnSig<'tcx>), TyDynamic(Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>, Region<'tcx>), TyClosure(DefId, ClosureSubsts<'tcx>), TyGenerator(DefId, GeneratorSubsts<'tcx>, GeneratorMovability), 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 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.
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>, Ty<'tcx>, Mutability)
🔬 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, GeneratorSubsts<'tcx>, GeneratorMovability)
🔬 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 either from
- the
impl Trait
ast::Ty node, - or the
existential type
declaration The substitutions are for the generics of the function in question. After typeck, the concrete type can be found in thetypes
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: 'lcx, 'lcx> Borrow<TypeVariants<'lcx>> for Interned<'tcx, TyS<'tcx>>
[src]
impl<'tcx: 'lcx, 'lcx> Borrow<TypeVariants<'lcx>> for Interned<'tcx, TyS<'tcx>>
fn borrow<'a>(&'a self) -> &'a TypeVariants<'lcx>
[src]
fn borrow<'a>(&'a self) -> &'a TypeVariants<'lcx>
Immutably borrows from an owned value. Read more
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, other: &TypeVariants<'tcx>) -> bool
[src]
fn eq(&self, other: &TypeVariants<'tcx>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TypeVariants<'tcx>) -> bool
[src]
fn ne(&self, other: &TypeVariants<'tcx>) -> bool
This method tests for !=
.
impl<'tcx> Eq for TypeVariants<'tcx>
[src]
impl<'tcx> Eq for TypeVariants<'tcx>
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl<'tcx> PartialOrd for TypeVariants<'tcx>
[src]
impl<'tcx> PartialOrd for TypeVariants<'tcx>
fn partial_cmp(&self, other: &TypeVariants<'tcx>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &TypeVariants<'tcx>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &TypeVariants<'tcx>) -> bool
[src]
fn lt(&self, other: &TypeVariants<'tcx>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &TypeVariants<'tcx>) -> bool
[src]
fn le(&self, other: &TypeVariants<'tcx>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &TypeVariants<'tcx>) -> bool
[src]
fn gt(&self, other: &TypeVariants<'tcx>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &TypeVariants<'tcx>) -> bool
[src]
fn ge(&self, other: &TypeVariants<'tcx>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'tcx> Ord for TypeVariants<'tcx>
[src]
impl<'tcx> Ord for TypeVariants<'tcx>
fn cmp(&self, other: &TypeVariants<'tcx>) -> Ordering
[src]
fn cmp(&self, other: &TypeVariants<'tcx>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<'tcx> Hash for TypeVariants<'tcx>
[src]
impl<'tcx> Hash for TypeVariants<'tcx>
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &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, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats 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, s: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, s: &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>(d: &mut __D) -> Result<TypeVariants<'tcx>, __D::Error>
[src]
fn decode<__D: Decoder>(d: &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>