Struct rustc_mir_build::thir::pattern::usefulness::PatStack [−][src]
struct PatStack<'p, 'tcx> {
pats: SmallVec<[&'p DeconstructedPat<'p, 'tcx>; 2]>,
}
Expand description
A row of a matrix. Rows of len 1 are very common, which is why SmallVec[_; 2]
works well.
Fields
pats: SmallVec<[&'p DeconstructedPat<'p, 'tcx>; 2]>
Implementations
fn pop_head_constructor(
&self,
cx: &MatchCheckCtxt<'p, 'tcx>,
ctor: &Constructor<'tcx>
) -> PatStack<'p, 'tcx>
fn pop_head_constructor(
&self,
cx: &MatchCheckCtxt<'p, 'tcx>,
ctor: &Constructor<'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
Auto Trait Implementations
impl<'p, 'tcx> !RefUnwindSafe for PatStack<'p, 'tcx>
impl<'p, 'tcx> !UnwindSafe for PatStack<'p, 'tcx>
Blanket Implementations
Mutably borrows from an owned value. Read more
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