rustdoc::html::render::print_item

Function should_show_enum_discriminant

source
fn should_show_enum_discriminant(
    cx: &Context<'_>,
    enum_def_id: DefId,
    variants: &IndexVec<VariantIdx, Item>,
) -> bool
Expand description

It’ll return false if any variant is not a C-like variant. Otherwise it’ll return true if at least one of them has an explicit discriminant or if the enum has #[repr(C)] or an integer repr.