-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constants of type BitFlags cannot be used in match expressions #60
Comments
I don't remember all the design constraints at this point – I'd have to go digging in the git history a bit more. One issue is that the current implementation doesn't require This creates compatibility issues – examples currently in the test suite will stop compiling. |
How can it perform |
It has |
Ah.. So, the problem can go out of |
Hmm, however according to this https://doc.rust-lang.org/src/core/marker.rs.html#749 it should not. |
Oh, that is a pretty serious limitation, and given the low priority, it looks like it's unlikely to ever be fixed. |
But is it so bad to require |
Well, it would require bumping the version to 0.8.0 |
Actually, I am not sure this will help. |
Yes, I'd suggest you clone the repo and try getting it to work in your project with |
Tried. Yes, it requires |
Constants of type
BitFlags
cannot be used as a pattern in match expressions because it has manually implementedPartialEq
trait.To be able to use constants of a type in match expressions, the type must derive
PartialEq
trait.Here is the exact error message:
But it looks like there is no need in manual implementation of
PartialEq
trait.It anyway just compares the inner values
Please consider deriving
PartialEq
.Thank you.
The text was updated successfully, but these errors were encountered: