Open manuthambi opened 3 years ago
Yes, that'd be fine. I don't particularly want to maintain a strict MSRP, just a reasonable one that doesn't constantly push it for no good reason. I can also see if I can work on this myself.
Do you have an idea of how to do this at a lower MSRV? This isn't even possible in stable right now because of trait bounds other than `Sized` on const fn parameters are unstable
. What I can do is make an flag that requires nightly for const fns, but otherwise, not much I can do.
What I can do instead is try to update the enum_set!
macro to support basic expressions and other constants.
Bummer! I didn't look too carefully into it, and assumed that it should be possible for inherent methods on stable.
Updating enum_set!
would be pretty hacky, right? :( Perhaps it is better to just wait for more const stuff to be stabilized.
Thank you for looking into it!
It would be, very much so. I'll still think about what I could do here, honestly...
Reopening this since it's planned. Still blocked on rustc features - but may try some workarounds in the meanwhile.
I've added some macros that should help with this. See the changelog:
This issue remains open because I don't think this can be properly solved until const fn
supports this stuff entirely natively.
I would love to have some methods like
intersection
,union
etc. const. Would help me avoid usinglazy_static!
oronce_cell::Lazy
at a bunch places in my code. This will probably require upping the MSRV. If you are open to this, I can send in a pull request.