-
Notifications
You must be signed in to change notification settings - Fork 35
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
proc-macro panic on FromPrimitive for u64 #102
Comments
Sidenote: It compiles in release. The error only occurs in debug builds. |
mlgiraud
added a commit
to mlgiraud/num_enum
that referenced
this issue
Feb 16, 2023
Large enums realistically will never be naturally exhaustive due to their size. The shift is now done as a checked shift and when the shift fails it will default to not naturally exhaustive, requiring the default attribute, even if it were exhaustive. (I want to meet the person who manages to write down 2^64 enum values or more)
@illicitonion Could you please review my fix i provided and merge as soon as you find the time? This is currently a blocker for our project. See #103 |
illicitonion
pushed a commit
that referenced
this issue
Feb 16, 2023
Large enums realistically will never be naturally exhaustive due to their size. The shift is now done as a checked shift and when the shift fails it will default to not naturally exhaustive, requiring the default attribute, even if it were exhaustive. (I want to meet the person who manages to write down 2^64 enum values or more)
Fixed by #103 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code
produces the error
It works as intended when using u32 or smaller types.
Rust version used: stable-x86_64-unknown-linux-gnu - Up to date : 1.67.1 (d5a82bbd2 2023-02-07)
The text was updated successfully, but these errors were encountered: