Enum rustc_mir::hair::pattern::PatternKind [−][src]
pub enum PatternKind<'tcx> { Wild, Binding { mutability: Mutability, name: Name, mode: BindingMode<'tcx>, var: NodeId, ty: Ty<'tcx>, subpattern: Option<Pattern<'tcx>>, }, Variant { adt_def: &'tcx AdtDef, substs: &'tcx Substs<'tcx>, variant_index: usize, subpatterns: Vec<FieldPattern<'tcx>>, }, Leaf { subpatterns: Vec<FieldPattern<'tcx>>, }, Deref { subpattern: Pattern<'tcx>, }, Constant { value: &'tcx Const<'tcx>, }, Range { lo: &'tcx Const<'tcx>, hi: &'tcx Const<'tcx>, end: RangeEnd, }, Slice { prefix: Vec<Pattern<'tcx>>, slice: Option<Pattern<'tcx>>, suffix: Vec<Pattern<'tcx>>, }, Array { prefix: Vec<Pattern<'tcx>>, slice: Option<Pattern<'tcx>>, suffix: Vec<Pattern<'tcx>>, }, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Variants
Wild
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Binding
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
x, ref x, x @ P, etc
Fields of Binding
mutability: Mutability | 🔬 This is a nightly-only experimental API. ( |
name: Name | 🔬 This is a nightly-only experimental API. ( |
mode: BindingMode<'tcx> | 🔬 This is a nightly-only experimental API. ( |
var: NodeId | 🔬 This is a nightly-only experimental API. ( |
ty: Ty<'tcx> | 🔬 This is a nightly-only experimental API. ( |
subpattern: Option<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
Variant
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Foo(...) or Foo{...} or Foo, where Foo
is a variant name from an adt with >1 variants
Fields of Variant
adt_def: &'tcx AdtDef | 🔬 This is a nightly-only experimental API. ( |
substs: &'tcx Substs<'tcx> | 🔬 This is a nightly-only experimental API. ( |
variant_index: usize | 🔬 This is a nightly-only experimental API. ( |
subpatterns: Vec<FieldPattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
Leaf
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
(...), Foo(...), Foo{...}, or Foo, where Foo
is a variant name from an adt with 1 variant
Fields of Leaf
subpatterns: Vec<FieldPattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
Deref
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
box P, &P, &mut P, etc
Fields of Deref
subpattern: Pattern<'tcx> | 🔬 This is a nightly-only experimental API. ( |
Constant
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of Constant
value: &'tcx Const<'tcx> | 🔬 This is a nightly-only experimental API. ( |
Range
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of Range
lo: &'tcx Const<'tcx> | 🔬 This is a nightly-only experimental API. ( |
hi: &'tcx Const<'tcx> | 🔬 This is a nightly-only experimental API. ( |
end: RangeEnd | 🔬 This is a nightly-only experimental API. ( |
Slice
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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..]
.
Fields of Slice
prefix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
slice: Option<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
suffix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
Array
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fixed match against an array, irrefutable
Fields of Array
prefix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
slice: Option<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
suffix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. ( |
Trait Implementations
impl<'tcx> Clone for PatternKind<'tcx>
[src]
impl<'tcx> Clone for PatternKind<'tcx>
fn clone(&self) -> PatternKind<'tcx>
[src]
fn clone(&self) -> PatternKind<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'tcx> Debug for PatternKind<'tcx>
[src]
impl<'tcx> Debug for PatternKind<'tcx>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'tcx> PatternFoldable<'tcx> for PatternKind<'tcx>
[src]
impl<'tcx> PatternFoldable<'tcx> for PatternKind<'tcx>
fn fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self
[src]
fn fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn super_fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self
[src]
fn super_fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl<'tcx> !Send for PatternKind<'tcx>
impl<'tcx> !Send for PatternKind<'tcx>
impl<'tcx> !Sync for PatternKind<'tcx>
impl<'tcx> !Sync for PatternKind<'tcx>