Struct rustc_mir_build::thir::pattern::usefulness::Matrix [−][src]
Expand description
A 2D matrix.
Fields
patterns: Vec<PatStack<'p, 'tcx>>Implementations
Number of columns of this matrix. None is the matrix is empty.
Pushes a new row to the matrix. If the row starts with an or-pattern, this recursively expands it.
Iterate over the first component of each row
pub(super) fn head_ctors<'a>(
&'a self,
cx: &'a MatchCheckCtxt<'p, 'tcx>
) -> impl Iterator<Item = &'a Constructor<'tcx>> + Captures<'p> + Clone
pub(super) fn head_ctors<'a>(
&'a self,
cx: &'a MatchCheckCtxt<'p, 'tcx>
) -> impl Iterator<Item = &'a Constructor<'tcx>> + Captures<'p> + CloneIterate over the first constructor of each row.
pub(super) fn head_ctors_and_spans<'a>(
&'a self,
cx: &'a MatchCheckCtxt<'p, 'tcx>
) -> impl Iterator<Item = (&'a Constructor<'tcx>, Span)> + Captures<'p>
pub(super) fn head_ctors_and_spans<'a>(
&'a self,
cx: &'a MatchCheckCtxt<'p, 'tcx>
) -> impl Iterator<Item = (&'a Constructor<'tcx>, Span)> + Captures<'p>Iterate over the first constructor and the corresponding span of each row.
fn specialize_constructor(
&self,
pcx: PatCtxt<'_, 'p, 'tcx>,
ctor: &Constructor<'tcx>,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> Matrix<'p, 'tcx>
fn specialize_constructor(
&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
Pretty-printer for matrices of patterns, example:
+ _ + [] +
+ true + [First] +
+ true + [Second(true)] +
+ false + [_] +
+ _ + [_, _, tail @ ..] +
Creates a value from an iterator. Read more
Auto Trait Implementations
impl<'p, 'tcx> !RefUnwindSafe for Matrix<'p, 'tcx>impl<'p, 'tcx> !UnwindSafe for Matrix<'p, 'tcx>Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may be different between compiler versions and platforms. 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