Closed juntyr closed 1 year ago
All modified lines are covered by tests :white_check_mark:
Comparison is base (
2f3e5a8
) 100.00% compared to head (2493a59
) 100.00%.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@torkleyy Holy dang, serde attributes are a mess. This nightmare has really only unearthed two or three bugs in ron (around tagged enum tag identifier deserialising), many cases where we cannot roundtrip because serde's Content loses information (see https://github.com/serde-rs/serde/issues/1183), but MANY nightmares around serde attributes just plain not roundtripping themselves. I will try to add some tests and update our restrictions README in the PR, but I won't spend any time prettifying our fuzzer at this point. It will hopefully get nicer over time as the above restrictions are lifted.
Hopefully I can get this PR merged early next week and then finally, with the confidence that we now know about the limitations of serde attributes in ron, release v0.9.
... and I need to fix those tests ... later. And as always, the fuzzer finds another bug just as I think I'm done with this ;(
@torkleyy I think this is finally ready (I want to merge and rebase on #512 first). Gosh this PR is huge ... and soooo cursed. And probably once the fuzzer changes lands I get many new edge case reports soon. But it is a small step phew*
Oh and the benchmark failure should be fixed by this PR too
Fixes #500, since all (known) roundtrip issues are now documented and tested. Once serde allows us to fix them, they can be removed from the newly expanded restrictions section.
[x] externally tagged enums
[x] internally tagged enums
[x] internally tagged structs
[x] adjacently tagged enums
[x] untagged enums
[x] other variant in internally tagged enums
[x] other variant in adjacently tagged enums
[x] serialize flattened struct
[x] serialize flattened struct variant
[x] deserialize flattened struct
[x] deserialize flattened struct variant
[x] document one-tuple/one-array limitation inside unwrapped newtype variants
[x]
document that serde only supports unit, bool, integer, float, char, string, and byte keys inside flattened structs, and only string and byte keys anddocument that we only support string keys inside flattened maps (even though serde technically permits more, this support is not roundtrip-safe as soon as flattened maps are involved)u8
andu64
when the flattened struct is inside an untagged or internally tagged enum[x] document that serde does not support flattened structs containing conflicting keys, e.g. an inner key matches a later outer key or two flattened maps in the same struct share a key
[x] document that
#[enable(implicit_some)]
is not supported withOption
s inside#[serde(flatten)]
[x] document that
PrettyConfig::struct_names(true)
is not supported inside flattened structs / struct variants[x] Add tests for any bug fixes
[x] Add tests for all known bugs
#[serde(flatten)]
ed field:#[serde(flatten)]
ed map field, which collects all unknown fields#[serde(flatten)]
ed map, they must not contain:#[serde(flatten)]
ed fields must not contain:i128
oru128
valuesPrettyConfig::struct_names
settingOption
s with#[enable(implicit_some)]
must not contain any of these or a unit, unit struct, or an untagged unit variant#[enable(unwrap_variant_newtypes)]
ron::value::RawValue
#![enable(unwrap_variant_newtypes)]
extension is enabled#[serde(flatten)]
ed fields must not contain:ron::value::RawValue
using aPrettyConfig
may add leading and trailing whitespace and comments, which theron::value::RawValue
absorbs upon deserialization[x] I've included my change in
CHANGELOG.md
[x] Check all
// BUG:
comments in the fuzzer again to ensure that nothing was missed / is unnecessary or out of place