## compute_discriminant_value

# Function compute_discriminant_value

Source

    fn compute_discriminant_value<'ll, 'tcx>(
        cx: &GenericCx<'ll, FullCx<'ll, 'tcx>>,
        enum_type_and_layout: TyAndLayout<'tcx>,
        variant_index: VariantIdx,
    ) -> DiscrResult

Expand description

Returns the discriminant value corresponding to the variant index.

Will return `None` if there is less than two variants (because then the enum won’t have) a tag, and if this is the untagged variant of a niche-layout enum (because then there is no single discriminant value).