Struct rustc_mir_build::thir::pattern::usefulness::Matrix
source · [−]Expand description
A 2D matrix.
Fields
patterns: Vec<PatStack<'p, 'tcx>>
Implementations
sourceimpl<'p, 'tcx> Matrix<'p, 'tcx>
impl<'p, 'tcx> Matrix<'p, 'tcx>
fn empty() -> Self
sourcepub(super) fn column_count(&self) -> Option<usize>
pub(super) fn column_count(&self) -> Option<usize>
Number of columns of this matrix. None
is the matrix is empty.
sourcefn push(&mut self, row: PatStack<'p, 'tcx>)
fn push(&mut self, row: PatStack<'p, 'tcx>)
Pushes a new row to the matrix. If the row starts with an or-pattern, this recursively expands it.
sourcefn heads<'a>(
&'a self
) -> impl Iterator<Item = &'p DeconstructedPat<'p, 'tcx>> + Clone + Captures<'a>
fn heads<'a>(
&'a self
) -> impl Iterator<Item = &'p DeconstructedPat<'p, 'tcx>> + Clone + Captures<'a>
Iterate over the first component of each row
sourcefn specialize_constructor(
&self,
pcx: &PatCtxt<'_, 'p, 'tcx>,
ctor: &Constructor<'tcx>
) -> Matrix<'p, 'tcx>
fn specialize_constructor(
&self,
pcx: &PatCtxt<'_, 'p, 'tcx>,
ctor: &Constructor<'tcx>
) -> Matrix<'p, 'tcx>
This computes S(constructor, self)
. See top of the file for explanations.
Trait Implementations
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,
impl<'p, 'tcx> !UnwindSafe for Matrix<'p, 'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes