rustc_builtin_macros::deriving::debug

Function show_fieldless_enum

source
fn show_fieldless_enum(
    cx: &ExtCtxt<'_>,
    span: Span,
    def: &EnumDef,
    substr: &Substructure<'_>,
) -> BlockOrExpr
Expand description

Special case for enums with no fields. Builds:

impl ::core::fmt::Debug for A {
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
         ::core::fmt::Formatter::write_str(f,
            match self {
                A::A => "A",
                A::B() => "B",
                A::C {} => "C",
            })
    }
}