[−][src]Module rustc_mir::hair::pattern::_match
🔬 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?
Structs
IntRange |
[ Experimental ] An inclusive interval, used for precise integer exhaustiveness checking.
|
LiteralExpander |
[ Experimental ]
|
MatchCheckCtxt |
[ Experimental ]
|
Matrix |
[ Experimental ]
|
PatternContext |
[ Experimental ]
|
Witness |
[ Experimental ] A witness of non-exhaustiveness for error reporting, represented as a list of patterns (in reverse order of construction) with wildcards inside to represent elements that can take any inhabitant of the type as a value. |
Enums
Constructor |
[ Experimental ]
|
Usefulness |
[ Experimental ]
|
WitnessPreference |
[ Experimental ]
|
Functions
all_constructors |
[ Experimental ] This determines the set of all possible constructors of a pattern matching
values of type |
compute_missing_ctors |
[ Experimental ]
|
constructor_arity |
[ Experimental ] This computes the arity of a constructor. The arity of a constructor is how many subpattern patterns of that constructor should be expanded to. |
constructor_covered_by_range |
[ Experimental ]
|
constructor_intersects_pattern |
[ Experimental ] Check whether there exists any shared value in either |
constructor_sub_pattern_tys |
[ Experimental ] This computes the types of the sub patterns that a constructor should be expanded to. |
expand_pattern |
[ Experimental ]
|
is_useful |
[ Experimental ] Algorithm from http://moscova.inria.fr/~maranget/papers/warn/index.html The algorithm from the paper has been modified to correctly handle empty types. The changes are: (0) We don't exit early if the pattern matrix has zero rows. We just continue to recurse over columns. (1) all_constructors will only return constructors that are statically possible. eg. it will only return Ok for Result<T, !> |
is_useful_specialized |
[ Experimental ] A shorthand for the |
max_slice_length |
[ Experimental ]
|
pat_constructors |
[ Experimental ] Determines the constructors that the given pattern can be specialized to. |
patterns_for_variant |
[ Experimental ]
|
should_treat_range_exhaustively |
[ Experimental ]
|
slice_pat_covered_by_constructor |
[ Experimental ]
|
specialize |
[ Experimental ] This is the main specialization step. It expands the first pattern in the given row
into |
split_grouped_constructors |
[ Experimental ] For exhaustive integer matching, some constructors are grouped within other constructors
(namely integer typed values are grouped within ranges). However, when specialising these
constructors, we want to be specialising for the underlying constructors (the integers), not
the groups (the ranges). Thus we need to split the groups up. Splitting them up naïvely would
mean creating a separate constructor for every single value in the range, which is clearly
impractical. However, observe that for some ranges of integers, the specialisation will be
identical across all values in that range (i.e. there are equivalence classes of ranges of
constructors based on their |