Compat note for RawValue/flattening & tagged enum #1252
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's not obvious that RawValue can't be used with serveral serde features, and the runtime errors are quite opaque. From the number of issues on github and annecdotally, people get bit by this fairly often.
This change simply adds a note to RawValue's doc comments about two such scenarios that it won't work with. The phrasing could probably be improved/tightned up and maybe links could be added to explain why? My brain is just fried from running into both cases today and not getting anything done as a result.
Alternately
It seems like these cases might be resolveable by Internal buffering disrupts format-specific deserialization features serde#1183 . Maybe this doc comment could reference that issue directly, instead.
Maybe the error messages could somehow be improved?
Related issues
Box<RawValue>
and#[serde(flatten)]
don't work together for deserialization #883Box<RawValue>
and#[serde(flatten)]
don't work together for deserialization #1099