Enum rustc::hir::Ty_
[−]
[src]
pub enum Ty_ {
TySlice(P<Ty>),
TyArray(P<Ty>, BodyId),
TyPtr(MutTy),
TyRptr(Lifetime, MutTy),
TyBareFn(P<BareFnTy>),
TyNever,
TyTup(HirVec<P<Ty>>),
TyPath(QPath),
TyTraitObject(HirVec<PolyTraitRef>, Lifetime),
TyImplTraitExistential(ExistTy, HirVec<Lifetime>),
TyImplTraitUniversal(DefId, TyParamBounds),
TyTypeof(BodyId),
TyInfer,
TyErr,
}🔬 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 different kinds of types recognized by the compiler
Variants
TySlice(P<Ty>)🔬 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 variable length slice ([T])
TyArray(P<Ty>, BodyId)🔬 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 fixed length array ([T; n])
TyPtr(MutTy)🔬 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 (*const T or *mut T)
TyRptr(Lifetime, MutTy)🔬 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 T or &'a mut T)
TyBareFn(P<BareFnTy>)🔬 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 bare function (e.g. fn(usize) -> bool)
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 (!)
TyTup(HirVec<P<Ty>>)🔬 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 ((A, B, C, D,...))
TyPath(QPath)🔬 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 path to a type definition (module::module::...::Type), or an
associated type, e.g. <Vec<T> as Trait>::Type or <T>::Target.
Type parameters may be stored in each PathSegment.
TyTraitObject(HirVec<PolyTraitRef>, Lifetime)🔬 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 object type Bound1 + Bound2 + Bound3
where Bound is a trait or a lifetime.
TyImplTraitExistential(ExistTy, HirVec<Lifetime>)🔬 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 exsitentially quantified (there exists a type satisfying) impl Bound1 + Bound2 + Bound3 type where Bound is a trait or a lifetime.
The ExistTy structure emulates an
abstract type Foo<'a, 'b>: MyTrait<'a, 'b>;.
The HirVec<Lifetime> is the list of lifetimes applied as parameters
to the abstract type, e.g. the 'c and 'd in -> Foo<'c, 'd>.
This list is only a list of lifetimes and not type parameters
because all in-scope type parameters are captured by impl Trait,
so they are resolved directly through the parent Generics.
TyImplTraitUniversal(DefId, TyParamBounds)🔬 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 universally quantified (for all types satisfying) impl Bound1 + Bound2 + Bound3 type where Bound is a trait or a lifetime.
TyTypeof(BodyId)🔬 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?
Unused for now
TyInfer🔬 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?
TyInfer means the type should be inferred instead of it having been specified. This can appear anywhere in a type.
TyErr🔬 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?
Placeholder for a type that has failed to be defined.
Trait Implementations
impl Clone for Ty_[src]
fn clone(&self) -> Ty_[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 PartialEq for Ty_[src]
fn eq(&self, __arg_0: &Ty_) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Ty_) -> bool[src]
This method tests for !=.
impl Eq for Ty_[src]
impl Encodable for Ty_[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 Decodable for Ty_[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Ty_, __D::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 Hash for Ty_[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 Debug for Ty_[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<'tcx> HashStable<StableHashingContext<'tcx>> for Ty_[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'tcx>,
__hasher: &mut StableHasher<W>
)[src]
&self,
__ctx: &mut StableHashingContext<'tcx>,
__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?