Pat in rustc_ast::ast - Rust (original) (raw)
pub struct Pat {
pub id: NodeId,
pub kind: PatKind,
pub span: Span,
pub tokens: Option<LazyAttrTokenStream>,
}
Expand description
A match pattern.
Patterns appear in match statements and some other contexts, such as let
and if let
.
Attempt reparsing the pattern as a type. This is intended for use by diagnostics.
Walk top-down and call it
in each place where a pattern occurs starting with the root pattern walk
is called on. If it
returns false then we will descend no further but siblings will be processed.
Is this a ..
pattern?
Whether this could be a never pattern, taking into account that a macro invocation can return a never pattern. Used to inform errors during parsing.
Whether this contains a !
pattern. This in particular means that a feature gate error will be raised if the feature is off. Used to avoid gating the feature twice.
Return a name suitable for diagnostics.
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: 72 bytes