[−][src]Struct rustc_middle::mir::UserTypeProjection

pub struct UserTypeProjection {
    pub base: UserTypeAnnotationIndex,
    pub projs: Vec<ProjectionKind>,
}

Encodes the effect of a user-supplied type annotation on the subcomponents of a pattern. The effect is determined by applying the given list of proejctions to some underlying base type. Often, the projection element list projs is empty, in which case this directly encodes a type in base. But in the case of complex patterns with subpatterns and bindings, we want to apply only a part of the type to a variable, in which case the projs vector is used.

Examples:

Fields

base: UserTypeAnnotationIndexprojs: Vec<ProjectionKind>

Implementations

impl UserTypeProjection[src]

pub(crate) fn index(self) -> Self[src]

pub(crate) fn subslice(self, from: u64, to: u64) -> Self[src]

pub(crate) fn deref(self) -> Self[src]

pub(crate) fn leaf(self, field: Field) -> Self[src]

pub(crate) fn variant(
    self,
    adt_def: &AdtDef,
    variant_index: VariantIdx,
    field: Field
) -> Self
[src]

Trait Implementations

impl Clone for UserTypeProjection[src]

impl Debug for UserTypeProjection[src]

impl<'tcx, __D: TyDecoder<'tcx>> Decodable<__D> for UserTypeProjection[src]

impl<'tcx, __E: TyEncoder<'tcx>> Encodable<__E> for UserTypeProjection[src]

impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for UserTypeProjection[src]

impl PartialEq<UserTypeProjection> for UserTypeProjection[src]

impl StructuralPartialEq for UserTypeProjection[src]

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

Auto Trait Implementations

impl RefUnwindSafe for UserTypeProjection

impl Send for UserTypeProjection

impl Sync for UserTypeProjection

impl Unpin for UserTypeProjection

impl UnwindSafe for UserTypeProjection

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[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> 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 = !

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]