-
Notifications
You must be signed in to change notification settings - Fork 59
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
Library panics when deserializing certain types due to unreachable!()
statements
#48
Comments
(The particular issue of |
These are all known at compile time. Shouldn't already the |
The derive is done in |
Closing, as I don't think this has any open defects anymore with newtype resolved. |
I think it's still pretty easy to hit, e.g. |
You can also hit an unreachable section by serializing an enum with a tuple element. |
I don't think this general behavior is a bug. It seems to be standard practice of serde trait implementations to panic on unimplemented/unimplementable things. What would be the alternative? |
I think the core issue is that it's marked as |
The title should probably reflect that then. |
unreachable!()
statements
I believe this should be mostly fixed now that #83 has made these functions return I think the only case you'll now hit these is if you use some non-string as a map key, such as |
When deserializing certain types, the library may hit
unreachable!()
statements, which results in a panic. This appears to be because serde-json-core does not support deserializing complex enums (e.g.pub struct Test(u32)
.That being said, the library should never internally panic. Instead, it should propagate an error out to the user.
The text was updated successfully, but these errors were encountered: