[−][src]Struct rustc_mir_build::thir::pattern::_match::PatStack

pub(crate) struct PatStack<'p, 'tcx>(SmallVec<[&'p Pat<'tcx>; 2]>);

A row of a matrix. Rows of len 1 are very common, which is why SmallVec[_; 2] works well.

Implementations

impl<'p, 'tcx> PatStack<'p, 'tcx>[src]

pub(crate) fn from_pattern(pat: &'p Pat<'tcx>) -> Self[src]

fn from_vec(vec: SmallVec<[&'p Pat<'tcx>; 2]>) -> Self[src]

fn from_slice(s: &[&'p Pat<'tcx>]) -> Self[src]

fn is_empty(&self) -> bool[src]

fn len(&self) -> usize[src]

fn head(&self) -> &'p Pat<'tcx>[src]

fn to_tail(&self) -> Self[src]

fn iter(&self) -> impl Iterator<Item = &Pat<'tcx>>[src]

fn expand_or_pat(&self) -> Option<Vec<Self>>[src]

fn specialize_wildcard(&self) -> Option<Self>[src]

This computes D(self). See top of the file for explanations.

fn specialize_constructor(
    &self,
    cx: &mut MatchCheckCtxt<'p, 'tcx>,
    constructor: &Constructor<'tcx>,
    ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> Option<PatStack<'p, 'tcx>>
[src]

This computes S(constructor, self). See top of the file for explanations.

Trait Implementations

impl<'p, 'tcx> Clone for PatStack<'p, 'tcx>[src]

impl<'p, 'tcx> Debug for PatStack<'p, 'tcx>[src]

impl<'p, 'tcx> Default for PatStack<'p, 'tcx>[src]

impl<'p, 'tcx> FromIterator<&'p Pat<'tcx>> for PatStack<'p, 'tcx>[src]

impl<'p, 'tcx> FromIterator<PatStack<'p, 'tcx>> for Matrix<'p, 'tcx>[src]

Auto Trait Implementations

impl<'p, 'tcx> !RefUnwindSafe for PatStack<'p, 'tcx>

impl<'p, 'tcx> !Send for PatStack<'p, 'tcx>

impl<'p, 'tcx> !Sync for PatStack<'p, 'tcx>

impl<'p, 'tcx> Unpin for PatStack<'p, 'tcx> where
    'tcx: 'p, 

impl<'p, 'tcx> !UnwindSafe for PatStack<'p, 'tcx>

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> 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.