[−][src]Enum rustc_mir_build::thir::pattern::PatKind
Variants
Fields of AscribeUserType
ascription: Ascription<'tcx>subpattern: Pat<'tcx>x, ref x, x @ P, etc.
Fields of Binding
mutability: Mutabilityname: Symbolmode: BindingModevar: HirIdty: Ty<'tcx>subpattern: Option<Pat<'tcx>>is_primary: boolIs this the leftmost occurrence of the binding, i.e., is var the
HirId of this pattern?
Foo(...) or Foo{...} or Foo, where Foo is a variant name from an ADT with
multiple variants.
Fields of Variant
adt_def: &'tcx AdtDefsubsts: SubstsRef<'tcx>variant_index: VariantIdxsubpatterns: Vec<FieldPat<'tcx>>(...), Foo(...), Foo{...}, or Foo, where Foo is a variant name from an ADT with
a single variant.
box P, &P, &mut P, etc.
Fields of Deref
subpattern: Pat<'tcx>One of the following:
&str, which will be handled as a string pattern and thus exhaustiveness checking will detect if you use the same string twice in different patterns.- integer, bool, char or float, which will be handled by exhaustivenes to cover exactly
its own value, similar to
&str, but these values are much simpler. - Opaque constants, that must not be matched structurally. So anything that does not derive
PartialEqandEq.
Fields of Constant
value: &'tcx Const<'tcx>Range(PatRange<'tcx>)Matches against a slice, checking the length and extracting elements.
irrefutable when there is a slice pattern and both prefix and suffix are empty.
e.g., &[ref xs @ ..].
Fixed match against an array; irrefutable.
An or-pattern, e.g. p | q.
Invariant: pats.len() >= 2.
Trait Implementations
impl<'tcx> Clone for PatKind<'tcx>[src]
impl<'tcx> Debug for PatKind<'tcx>[src]
impl<'tcx> PartialEq<PatKind<'tcx>> for PatKind<'tcx>[src]
pub fn eq(&self, other: &PatKind<'tcx>) -> bool[src]
pub fn ne(&self, other: &PatKind<'tcx>) -> bool[src]
impl<'tcx> PatternFoldable<'tcx> for PatKind<'tcx>[src]
pub(crate) fn fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self[src]
pub(crate) fn super_fold_with<F: PatternFolder<'tcx>>(
&self,
folder: &mut F
) -> Self[src]
&self,
folder: &mut F
) -> Self
impl<'tcx> StructuralPartialEq for PatKind<'tcx>[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for PatKind<'tcx>
impl<'tcx> !Send for PatKind<'tcx>
impl<'tcx> !Sync for PatKind<'tcx>
impl<'tcx> Unpin for PatKind<'tcx>
impl<'tcx> !UnwindSafe for PatKind<'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,