[−][src]Module rustc_mir_build::thir::pattern::deconstruct_pat

This module provides functions to deconstruct and reconstruct patterns into a constructor applied to some fields. This is used by the _match module to compute pattern usefulness/exhaustiveness.

Structs

IntRange

An inclusive interval, used for precise integer exhaustiveness checking. IntRanges always store a contiguous range. This means that values are encoded such that 0 encodes the minimum value for the integer, regardless of the signedness. For example, the pattern -128..=127i8 is encoded as 0..=255. This makes comparisons and arithmetic on interval endpoints much more straightforward. See signed_bias for details.

MissingConstructors
Slice

A constructor for array and slice patterns.

Enums

Constructor

A value can be decomposed into a constructor applied to some fields. This struct represents the constructor. See also Fields.

Fields

A value can be decomposed into a constructor applied to some fields. This struct represents those fields, generalized to allow patterns in each field. See also Constructor.

FilteredField

Some fields need to be explicitly hidden away in certain cases; see the comment above the Fields struct. This struct represents such a potentially-hidden field. When a field is hidden we still keep its type around.

SliceKind

Functions

all_constructors

This determines the set of all possible constructors of a pattern matching values of type left_ty. For vectors, this would normally be an infinite set but is instead bounded by the maximum fixed length of slice patterns in the column of patterns being analyzed.