Skip to content

Debug formatting leads to less desireable output #215

@damageboy

Description

@damageboy

Link to rust playground

#[macro_use]
extern crate bitflags;

bitflags! {
    struct Flags: u32 {
        const A = 0b00000001;
        const B = 0b00000010;
        const C = 0b00000100;
        const ABC = Self::A.bits | Self::B.bits | Self::C.bits;
    }
}

fn main() {
    println!("{:?}", Flags::A | Flags::B | Flags::C );
}

prints:

A | B | C | ABC

I find it somewhat less helpful that both the expanded (A | B | C) and "compressed" form (ABC) are reported...

Is there a reason behind this? Is this considered more correct for some reason?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions