Struct rustc_mir_build::thir::pattern::usefulness::PatStack [−][src]
struct PatStack<'p, 'tcx> {
pats: SmallVec<[&'p Pat<'tcx>; 2]>,
head_ctor: OnceCell<Constructor<'tcx>>,
}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 Pat<'tcx>; 2]>head_ctor: OnceCell<Constructor<'tcx>>Cache for the constructor of the head
Implementations
fn pop_head_constructor(
&self,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> PatStack<'p, 'tcx>
fn pop_head_constructor(
&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
Pretty-printing for matrix row.
Creates a value from an iterator. Read more
Creates a value from an iterator. Read more
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 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: 72 bytes