Enum rustc::hir::PatKind [] [src]

pub enum PatKind {
    Wild,
    Binding(BindingAnnotationNodeIdSpanned<Name>, Option<P<Pat>>),
    Struct(QPathHirVec<Spanned<FieldPat>>, bool),
    TupleStruct(QPathHirVec<P<Pat>>, Option<usize>),
    Path(QPath),
    Tuple(HirVec<P<Pat>>, Option<usize>),
    Box(P<Pat>),
    Ref(P<Pat>, Mutability),
    Lit(P<Expr>),
    Range(P<Expr>, P<Expr>, RangeEnd),
    Slice(HirVec<P<Pat>>, Option<P<Pat>>, HirVec<P<Pat>>),
}
🔬 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

🔬 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?

Represents a wildcard pattern (_)

🔬 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?

A fresh binding ref mut binding @ OPT_SUBPATTERN. The NodeId is the canonical ID for the variable being bound, e.g. in Ok(x) | Err(x), both x use the same canonical ID, which is the pattern ID of the first x.

🔬 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?

A struct or struct variant pattern, e.g. Variant {x, y, ..}. The bool is true in the presence of a ...

🔬 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?

A tuple struct/variant pattern Variant(x, y, .., z). If the .. pattern fragment is present, then Option<usize> denotes its position. 0 <= position <= subpats.len()

🔬 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?

A path pattern for an unit struct/variant or a (maybe-associated) 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?

A tuple pattern (a, b). If the .. pattern fragment is present, then Option<usize> denotes its position. 0 <= position <= subpats.len()

🔬 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?

A box pattern

🔬 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?

A reference pattern, e.g. &mut (a, b)

🔬 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?

A literal

🔬 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?

A range pattern, e.g. 1...2 or 1..2

🔬 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?

[a, b, ..i, y, z] is represented as: PatKind::Slice(box [a, b], Some(i), box [y, z])

Trait Implementations

impl Clone for PatKind
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for PatKind
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for PatKind
[src]

impl Encodable for PatKind
[src]

[src]

🔬 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?

impl Decodable for PatKind
[src]

[src]

🔬 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?

impl Hash for PatKind
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for PatKind
[src]

[src]

Formats the value using the given formatter.

impl<'tcx> HashStable<StableHashingContext<'tcx>> for PatKind
[src]

[src]

🔬 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?