-
Notifications
You must be signed in to change notification settings - Fork 123
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
Untagged enum roundtrip issues #500
Comments
I have given this a bit more thought. The untagged struct variant issue is caused by
We could technically fix this with significant changes to ron, e.g. making the While possible, I don't think that this is a very sustainable direction for ron to take. After all, optional struct names, required variant names, and no enum names are specific features of the format, none of which cause any problems when In the end, format-specific buffering support in serde would fix this and many other issues. Unfortunately, even though this could be implemented in serde today (see serde-rs/serde#1354), dtolnay has indicated that serde will instead wait for associated type default to be stabilized, which might be quite a while. I'm not quite sure where we go from here. Do we just document these limitations (and publish v0.9 with them)? Do we change the ron format? Do we unionise with other serde formats and demand a timeline for format-specific buffering /hj? |
I would leave the format as-is and document it, this seems like a very specific problem and we can't do anything about the root cause (other than waiting). |
Ok, that sounds reasonable! Since discovering and fixing more issues with serde's enum representations is definitely a longer project (see https://github.com/juntyr/ron/tree/fuzz-untagged for a rough start), I'd propose to push that after the v0.9 release. For now, I'll document what we know to be problematic, e.g. "ron strives to support most #[serde(untagged)] use cases. However, the following cases are known to not roundtrip: ... . Please file an issue if you come across a use case which is not listed here but still breaks." |
The following cases do not roundtrip:
PrettyConfig::default().struct_names(true)
, since"\"hi\""
is the raw value"\"hi\""
but the serde content"hi"
The text was updated successfully, but these errors were encountered: