The bitflags crate define most (all?) of its functions on the struct itself, in addition to the Flags trait. Could you define the functions of Bitflag on the implementors of Bitflag, as const?
It's super useful not having to import the trait when using the bitflags crate.
I'm guessing struct BitFlags functions aren't const due to MSRV, but could there be a feature flag to make them const? Or do const functions not work at all in generic impls?
The
bitflagscrate define most (all?) of its functions on the struct itself, in addition to theFlagstrait. Could you define the functions ofBitflagon the implementors ofBitflag, as const?It's super useful not having to import the trait when using the
bitflagscrate.I'm guessing
struct BitFlagsfunctions aren't const due to MSRV, but could there be a feature flag to make them const? Or do const functions not work at all in generic impls?