Type Alias rustc_pattern_analysis::rustc::Constructor
source · pub type Constructor<'p, 'tcx> = Constructor<RustcMatchCheckCtxt<'p, 'tcx>>;Aliased Type§
enum Constructor<'p, 'tcx> {
Show 16 variants
Struct,
Variant(VariantIdx),
Ref,
Slice(Slice),
UnionField,
Bool(bool),
IntRange(IntRange),
F32Range(IeeeFloat<SingleS>, IeeeFloat<SingleS>, RangeEnd),
F64Range(IeeeFloat<DoubleS>, IeeeFloat<DoubleS>, RangeEnd),
Str(Const<'tcx>),
Opaque(OpaqueId),
Or,
Wildcard,
NonExhaustive,
Hidden,
Missing,
}Variants§
Struct
Tuples and structs.
Variant(VariantIdx)
Enum variants.
Ref
References
Slice(Slice)
Array and slice patterns.
UnionField
Union field accesses.
Bool(bool)
Booleans
IntRange(IntRange)
Ranges of integer literal values (2, 2..=5 or 2..5).
F32Range(IeeeFloat<SingleS>, IeeeFloat<SingleS>, RangeEnd)
Ranges of floating-point literal values (2.0..=5.2).
F64Range(IeeeFloat<DoubleS>, IeeeFloat<DoubleS>, RangeEnd)
Str(Const<'tcx>)
String literals. Strings are not quite the same as &[u8] so we treat them separately.
Opaque(OpaqueId)
Constants that must not be matched structurally. They are treated as black boxes for the
purposes of exhaustiveness: we must not inspect them, and they don’t count towards making a
match exhaustive.
Carries an id that must be unique within a match. We need this to ensure the invariants of
SplitConstructorSet.
Or
Or-pattern.
Wildcard
Wildcard pattern.
NonExhaustive
Fake extra constructor for enums that aren’t allowed to be matched exhaustively. Also used
for those types for which we cannot list constructors explicitly, like f64 and str.
Hidden
Fake extra constructor for variants that should not be mentioned in diagnostics.
We use this for variants behind an unstable gate as well as
#[doc(hidden)] ones.
Missing
Fake extra constructor for constructors that are not seen in the matrix, as explained at the top of the file.
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: 80 bytes
Size for each variant:
Struct: 0 bytesVariant: 7 bytesRef: 0 bytesSlice: 47 bytesUnionField: 0 bytesBool: 1 byteIntRange: 79 bytesF32Range: 79 bytesF64Range: 79 bytesStr: 47 bytesOpaque: 7 bytesOr: 0 bytesWildcard: 0 bytesNonExhaustive: 0 bytesHidden: 0 bytesMissing: 0 bytes