pub(crate) enum PatKind<'db> {
Wild,
Never,
Binding {
name: Name,
subpattern: Option<Pat<'db>>,
},
Variant {
substs: GenericArgs<'db>,
enum_variant: EnumVariantId,
subpatterns: Vec<FieldPat<'db>>,
},
Leaf {
subpatterns: Vec<FieldPat<'db>>,
},
Deref {
subpattern: Pat<'db>,
},
LiteralBool {
value: bool,
},
Or {
pats: Vec<Pat<'db>>,
},
}Expand description
Close relative to rustc_mir_build::thir::pattern::PatKind
Variants§
Wild
Never
Binding
x, ref x, x @ P, etc.
Variant
Foo(...) or Foo{...} or Foo, where Foo is a variant name from an ADT with
multiple variants.
Leaf
(...), Foo(...), Foo{...}, or Foo, where Foo is a variant name from an ADT with
a single variant.
Deref
&P, &mut P, etc.
LiteralBool
Or
An or-pattern, e.g. p | q.
Invariant: pats.len() >= 2.
Trait Implementations§
Source§impl<'db> PartialEq for PatKind<'db>
impl<'db> PartialEq for PatKind<'db>
impl<'db> StructuralPartialEq for PatKind<'db>
Auto Trait Implementations§
impl<'db> Freeze for PatKind<'db>
impl<'db> RefUnwindSafe for PatKind<'db>
impl<'db> Send for PatKind<'db>
impl<'db> Sync for PatKind<'db>
impl<'db> Unpin for PatKind<'db>
impl<'db> UnsafeUnpin for PatKind<'db>
impl<'db> UnwindSafe for PatKind<'db>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more