[−][src]Struct rustc_mir_build::thir::pattern::_match::Matrix
A 2D matrix.
Fields
patterns: Vec<PatStack<'p, 'tcx>>Implementations
impl<'p, 'tcx> Matrix<'p, 'tcx>[src]
pub(in thir::pattern::_match) fn empty(
) -> Self[src]
) -> Self
pub(in thir::pattern::_match) fn push(
&mut self,
row: PatStack<'p, 'tcx>
)[src]
&mut self,
row: PatStack<'p, 'tcx>
)
Pushes a new row to the matrix. If the row starts with an or-pattern, this expands it.
pub(in thir::pattern::_match) fn heads<'a>(
&'a self
) -> impl Iterator<Item = &'a Pat<'tcx>> + Captures<'p>[src]
&'a self
) -> impl Iterator<Item = &'a Pat<'tcx>> + Captures<'p>
Iterate over the first component of each row
pub(in thir::pattern::_match) fn head_ctors<'a>(
&'a self,
cx: &'a MatchCheckCtxt<'p, 'tcx>
) -> impl Iterator<Item = &'a Constructor<'tcx>> + Captures<'a> + Captures<'p>[src]
&'a self,
cx: &'a MatchCheckCtxt<'p, 'tcx>
) -> impl Iterator<Item = &'a Constructor<'tcx>> + Captures<'a> + Captures<'p>
Iterate over the first constructor of each row
pub(in thir::pattern::_match) fn specialize_constructor(
&self,
pcx: PatCtxt<'_, 'p, 'tcx>,
ctor: &Constructor<'tcx>,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> Matrix<'p, 'tcx>[src]
&self,
pcx: PatCtxt<'_, 'p, 'tcx>,
ctor: &Constructor<'tcx>,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> Matrix<'p, 'tcx>
This computes S(constructor, self). See top of the file for explanations.
Trait Implementations
impl<'p, 'tcx> Clone for Matrix<'p, 'tcx>[src]
impl<'p, 'tcx> Debug for Matrix<'p, 'tcx>[src]
Pretty-printer for matrices of patterns, example:
+++++++++++++++++++++++++++++
+ _ + [] +
+++++++++++++++++++++++++++++
+ true + [First] +
+++++++++++++++++++++++++++++
+ true + [Second(true)] +
+++++++++++++++++++++++++++++
+ false + [_] +
+++++++++++++++++++++++++++++
+ _ + [_, _, tail @ ..] +
+++++++++++++++++++++++++++++
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<Matrix<'p, 'tcx>> for Matrix<'p, 'tcx>[src]
pub fn eq(&self, other: &Matrix<'p, 'tcx>) -> bool[src]
pub fn ne(&self, other: &Matrix<'p, 'tcx>) -> bool[src]
impl<'p, 'tcx> StructuralPartialEq for Matrix<'p, 'tcx>[src]
Auto Trait Implementations
impl<'p, 'tcx> !RefUnwindSafe for Matrix<'p, 'tcx>
impl<'p, 'tcx> !Send for Matrix<'p, 'tcx>
impl<'p, 'tcx> !Sync for Matrix<'p, 'tcx>
impl<'p, 'tcx> Unpin for Matrix<'p, 'tcx> where
'tcx: 'p,
'tcx: 'p,
impl<'p, 'tcx> !UnwindSafe for Matrix<'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>,