Struct rustc_pattern_analysis::usefulness::PatStack
source · struct PatStack<'a, 'p, Cx: TypeCx> {
pats: SmallVec<[&'a DeconstructedPat<'p, Cx>; 2]>,
}Expand description
Represents a pattern-tuple under investigation.
Fields§
§pats: SmallVec<[&'a DeconstructedPat<'p, Cx>; 2]>Implementations§
source§impl<'a, 'p, Cx: TypeCx> PatStack<'a, 'p, Cx>
impl<'a, 'p, Cx: TypeCx> PatStack<'a, 'p, Cx>
fn from_pattern(pat: &'a DeconstructedPat<'p, Cx>) -> Self
fn is_empty(&self) -> bool
fn len(&self) -> usize
fn head(&self) -> &'a DeconstructedPat<'p, Cx>
fn iter<'b>( &'b self ) -> impl Iterator<Item = &'a DeconstructedPat<'p, Cx>> + Captures<'b>
fn expand_or_pat<'b>( &'b self ) -> impl Iterator<Item = PatStack<'a, 'p, Cx>> + Captures<'b>
sourcefn pop_head_constructor(
&self,
pcx: &PlaceCtxt<'a, 'p, Cx>,
ctor: &Constructor<Cx>
) -> PatStack<'a, 'p, Cx>
fn pop_head_constructor( &self, pcx: &PlaceCtxt<'a, 'p, Cx>, ctor: &Constructor<Cx> ) -> PatStack<'a, 'p, Cx>
This computes specialize(ctor, self). See top of the file for explanations.
Only call if ctor.is_covered_by(self.head().ctor()) is true.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'p, Cx> !RefUnwindSafe for PatStack<'a, 'p, Cx>
impl<'a, 'p, Cx> !Send for PatStack<'a, 'p, Cx>
impl<'a, 'p, Cx> !Sync for PatStack<'a, 'p, Cx>
impl<'a, 'p, Cx> Unpin for PatStack<'a, 'p, Cx>
impl<'a, 'p, Cx> !UnwindSafe for PatStack<'a, 'p, Cx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn 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