Type Alias rustc_pattern_analysis::rustc::ConstructorSet
source · pub type ConstructorSet<'p, 'tcx> = ConstructorSet<RustcPatCtxt<'p, 'tcx>>;
Aliased Type§
enum ConstructorSet<'p, 'tcx> {
Struct {
empty: bool,
},
Variants {
variants: IndexVec<VariantIdx, VariantVisibility>,
non_exhaustive: bool,
},
Ref,
Union,
Bool,
Integers {
range_1: IntRange,
range_2: Option<IntRange>,
},
Slice {
array_len: Option<usize>,
subtype_is_empty: bool,
},
Unlistable,
NoConstructors,
}
Variants§
Struct
The type is a tuple or struct. empty
tracks whether the type is empty.
Variants
This type has the following list of constructors. If variants
is empty and
non_exhaustive
is false, don’t use this; use NoConstructors
instead.
Ref
The type is &T
.
Union
The type is a union.
Bool
Booleans.
Integers
The type is spanned by integer values. The range or ranges give the set of allowed values.
The second range is only useful for char
.
Slice
The type is matched by slices. array_len
is the compile-time length of the array, if
known. If subtype_is_empty
, all constructors are empty except possibly the zero-length
slice []
.
Unlistable
The constructors cannot be listed, and the type cannot be matched exhaustively. E.g. str
,
floats.
NoConstructors
The type has no constructors (not even empty ones). This is !
and empty enums.
Layout§
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: 128 bytes
Size for each variant:
Struct
: 17 bytesVariants
: 48 bytesRef
: 0 bytesUnion
: 0 bytesBool
: 0 bytesIntegers
: 128 bytesSlice
: 40 bytesUnlistable
: 0 bytesNoConstructors
: 0 bytes