Function rustc_mir::hair::pattern::_match::pat_constructors [−][src]
fn pat_constructors<'tcx>(
_cx: &mut MatchCheckCtxt,
pat: &Pattern<'tcx>,
pcx: PatternContext
) -> Option<Vec<Constructor<'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?
Determines the constructors that the given pattern can be specialized to.
In most cases, there's only one constructor that a specific pattern
represents, such as a specific enum variant or a specific literal value.
Slice patterns, however, can match slices of different lengths. For instance,
[a, b, ..tail]
can match a slice of length 2, 3, 4 and so on.
Returns None in case of a catch-all, which can't be specialized.