Function rustc_const_eval::check_match::specialize
[−]
[src]
pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat], constructor: &Constructor, col: usize, arity: usize) -> Option<Vec<&'a Pat>>
Unstable (
rustc_private
)This is the main specialization step. It expands the first pattern in the given row
into arity
patterns based on the constructor. For most patterns, the step is trivial,
for instance tuple patterns are flattened and box patterns expand into their inner pattern.
OTOH, slice patterns with a subslice pattern (..tail) can be expanded into multiple different patterns. Structure patterns with a partial wild pattern (Foo { a: 42, .. }) have their missing fields filled with wild patterns.