[−][src]Struct rustc_mir_build::thir::pattern::_match::PatStack
A row of a matrix. Rows of len 1 are very common, which is why SmallVec[_; 2]
works well.
Fields
pats: SmallVec<[&'p Pat<'tcx>; 2]>head_ctor: OnceCell<Constructor<'tcx>>Cache for the constructor of the head
Implementations
impl<'p, 'tcx> PatStack<'p, 'tcx>[src]
pub(in thir::pattern::_match) fn from_pattern(
pat: &'p Pat<'tcx>
) -> Self[src]
pat: &'p Pat<'tcx>
) -> Self
pub(in thir::pattern::_match) fn from_vec(
vec: SmallVec<[&'p Pat<'tcx>; 2]>
) -> Self[src]
vec: SmallVec<[&'p Pat<'tcx>; 2]>
) -> Self
pub(in thir::pattern::_match) fn is_empty(
&self
) -> bool[src]
&self
) -> bool
pub(in thir::pattern::_match) fn len(
&self
) -> usize[src]
&self
) -> usize
pub(in thir::pattern::_match) fn head(
&self
) -> &'p Pat<'tcx>[src]
&self
) -> &'p Pat<'tcx>
pub(in thir::pattern::_match) fn head_ctor<'a>(
&'a self,
cx: &MatchCheckCtxt<'p, 'tcx>
) -> &'a Constructor<'tcx>[src]
&'a self,
cx: &MatchCheckCtxt<'p, 'tcx>
) -> &'a Constructor<'tcx>
pub(in thir::pattern::_match) fn iter(
&self
) -> impl Iterator<Item = &Pat<'tcx>>[src]
&self
) -> impl Iterator<Item = &Pat<'tcx>>
pub(in thir::pattern::_match) fn expand_or_pat(
&self
) -> Option<Vec<Self>>[src]
&self
) -> Option<Vec<Self>>
pub(in thir::pattern::_match) fn pop_head_constructor(
&self,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> PatStack<'p, 'tcx>[src]
&self,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> PatStack<'p, 'tcx>
This computes S(self.head_ctor(), self). See top of the file for explanations.
Structure patterns with a partial wild pattern (Foo { a: 42, .. }) have their missing fields filled with wild patterns.
This is roughly the inverse of Constructor::apply.
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]
pub fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = &'p Pat<'tcx>>, [src]
T: IntoIterator<Item = &'p Pat<'tcx>>,
impl<'p, 'tcx> FromIterator<PatStack<'p, 'tcx>> for Matrix<'p, 'tcx>[src]
pub fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = PatStack<'p, 'tcx>>, [src]
T: IntoIterator<Item = PatStack<'p, 'tcx>>,
impl<'p, 'tcx> PartialEq<PatStack<'p, 'tcx>> for PatStack<'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,
'tcx: 'p,
impl<'p, 'tcx> !UnwindSafe for PatStack<'p, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,