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:
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?