[][src]Struct rustc::mir::tcx::PlaceTy

pub struct PlaceTy<'tcx> {
    pub ty: Ty<'tcx>,
    pub variant_index: Option<VariantIdx>,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Fields

ty: Ty<'tcx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

variant_index: Option<VariantIdx>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Downcast to a particular variant of an enum, if included.

Methods

impl<'tcx> PlaceTy<'tcx>[src]

pub fn from_ty(ty: Ty<'tcx>) -> PlaceTy<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn field_ty(self, tcx: TyCtxt<'tcx>, f: &Field) -> Ty<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

place_ty.field_ty(tcx, f) computes the type at a given field of a record or enum-variant. (Most clients of PlaceTy can instead just extract the relevant type directly from their PlaceElem, but some instances of ProjectionElem<V, T> do not carry a Ty for T.)

Note that the resulting type has not been normalized.

pub fn projection_ty(
    self,
    tcx: TyCtxt<'tcx>,
    elem: &PlaceElem<'tcx>
) -> PlaceTy<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Convenience wrapper around projection_ty_core for PlaceElem, where we can just use the Ty that is already stored inline on field projection elems.

pub fn projection_ty_core<V, T>(
    self,
    tcx: TyCtxt<'tcx>,
    param_env: ParamEnv<'tcx>,
    elem: &ProjectionElem<V, T>,
    handle_field: impl FnMut(&Self, &Field, &T) -> Ty<'tcx>
) -> PlaceTy<'tcx> where
    V: Debug,
    T: Debug
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

place_ty.projection_ty_core(tcx, elem, |...| { ... }) projects place_ty onto elem, returning the appropriate Ty or downcast variant corresponding to that projection. The handle_field callback must map a Field to its Ty, (which should be trivial when T = Ty).

Trait Implementations

impl<'tcx> Clone for PlaceTy<'tcx>[src]

impl<'tcx> Copy for PlaceTy<'tcx>[src]

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

impl<'tcx> TypeFoldable<'tcx> for PlaceTy<'tcx>[src]

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for PlaceTy<'tcx>

impl<'tcx> !Send for PlaceTy<'tcx>

impl<'tcx> !Sync for PlaceTy<'tcx>

impl<'tcx> Unpin for PlaceTy<'tcx>

impl<'tcx> !UnwindSafe for PlaceTy<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ArenaAllocatable for T where
    T: Copy
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<E> SpecializationError for E[src]

impl<'tcx, T> Subst<'tcx> for T where
    T: TypeFoldable<'tcx>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]