Variants::Single: do not use invalid VariantIdx for uninhabited enums

This commit is contained in:
Ralf Jung
2024-12-01 13:12:43 +01:00
parent 37e74596c0
commit 21de42bf8d
47 changed files with 549 additions and 281 deletions

View File

@@ -181,6 +181,7 @@ impl FieldsShape {
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize)]
pub enum VariantsShape {
/// Single enum variants, structs/tuples, unions, and all non-ADTs.
// FIXME: needs to become `Option` like in the internal type.
Single { index: VariantIdx },
/// Enum-likes with more than one inhabited variant: each variant comes with