You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have an outer struct that has two optional inner structs that are flattened, then the second one doesn't deserialize properly if it shares any fields with the struct of the field before it.
The problem is that there's an intermediate __collect buffer that partially gets consumed by the attempt to deserialize A (in particular the shared field). This makes it impossible for B to deserialize properly.
The content being taken out of the buffer happens at the end here:
If I have an outer struct that has two optional inner structs that are flattened, then the second one doesn't deserialize properly if it shares any fields with the struct of the field before it.
So in the example they both share the
shared
field. The problem comes from the code that's generated for theOuter
type'svisit_map
implementation:The problem is that there's an intermediate
__collect
buffer that partially gets consumed by the attempt to deserializeA
(in particular theshared
field). This makes it impossible forB
to deserialize properly.The content being taken out of the buffer happens at the end here:
serde/serde/src/private/de.rs
Lines 2830 to 2847 in 3bfab6e
The text was updated successfully, but these errors were encountered: