-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
Fix incorrect representation of tuple variants with skipped fields #2549
base: master
Are you sure you want to change the base?
Commits on Jul 23, 2024
-
Move code that generates reading from a SeqAccess to a dedicated func…
…tion (review this with whitespace changes ignored)
Configuration menu - View commit details
-
Copy full SHA for 7b57fb4 - Browse repository at this point
Copy the full SHA 7b57fb4View commit details -
Make
deserialize_seq
generic, parameterize it with data reading fun……ction and rename it
Configuration menu - View commit details
-
Copy full SHA for 35df5ee - Browse repository at this point
Copy the full SHA 35df5eeView commit details -
Inline
deserialize_newtype_struct
and `deserialize_newtype_struct_i……n_place` Those functions too small and used only once (review this with whitespace changes ignored)
Configuration menu - View commit details
-
Copy full SHA for bdf3793 - Browse repository at this point
Copy the full SHA bdf3793View commit details -
Correctly process skipped fields in visit_newtype_struct
Changes in generated code (see the file attached to PR): Tuple1as0: Tuple1as0Default: Tuple1as0With: fixed visit_newtype_struct: use default value instead of deserializing it This fixes compilation error for Deserialize side of Tuple1as0(Skipped) tuple
Configuration menu - View commit details
-
Copy full SHA for 918c1a2 - Browse repository at this point
Copy the full SHA 918c1a2View commit details -
Add tests for skipped fields in different kinds of structs
Enums out of scope for now, because they have too many problems failures (1): tuple_struct::tuple2as1 compilation error (commented): tuple_struct::tuple1as0
Configuration menu - View commit details
-
Copy full SHA for 22f4221 - Browse repository at this point
Copy the full SHA 22f4221View commit details -
Change Tuple1as0(Skipped) representation: newtype -> tuple(0), simila…
…r to Tuple0() struct A side-effect: Tuple2as1(Skipped, x) now also can be deserialized using visit_newtype_struct Changes in generated code (see the file attached to PR): Tuple1as0: Tuple1as0Default: Tuple1as0With: removed visit_newtype_struct, *_newtype_struct -> *_tuple_struct(0) Tuple2as1: Tuple2as1Default: Tuple2as1With: added visit_newtype_struct This commit fixes compilation error and actually fixes the issue as it was reported in serde-rs#2105
Configuration menu - View commit details
-
Copy full SHA for 9598ba1 - Browse repository at this point
Copy the full SHA 9598ba1View commit details -
Add tests for skipped fields in different kinds of enums
failures (15): enum_::adjacently_tagged::tuple_struct::tuple0 enum_::adjacently_tagged::tuple_struct::tuple1 enum_::adjacently_tagged::tuple_struct::tuple2as0 enum_::adjacently_tagged::tuple_struct::tuple2as1 enum_::adjacently_tagged::unit enum_::externally_tagged::tuple_struct::tuple0 enum_::externally_tagged::tuple_struct::tuple1 enum_::externally_tagged::tuple_struct::tuple1as0 enum_::externally_tagged::tuple_struct::tuple2as0 enum_::externally_tagged::tuple_struct::tuple2as1 enum_::internally_tagged::tuple_struct::tuple1 enum_::untagged::tuple_struct::tuple0 enum_::untagged::tuple_struct::tuple1as0 enum_::untagged::tuple_struct::tuple2as0 enum_::untagged::tuple_struct::tuple2as1 compilation error (commented): enum_::adjacently_tagged::tuple_struct::tuple1as0 enum_::internally_tagged::tuple_struct::tuple0 enum_::internally_tagged::tuple_struct::tuple2as0 enum_::internally_tagged::tuple_struct::tuple2as1
Configuration menu - View commit details
-
Copy full SHA for 228f9cc - Browse repository at this point
Copy the full SHA 228f9ccView commit details -
Correctly process skipped fields in tuple variants of internally tagg…
…ed enums Add methods to calculate effective style of variant
Configuration menu - View commit details
-
Copy full SHA for f7ecf33 - Browse repository at this point
Copy the full SHA f7ecf33View commit details -
Correctly serialize tuple variants with permanently skipped fields
Does not change anything in the generated code, but the new code will correctly process tuple variants when serialization style would compute correctly
Configuration menu - View commit details
-
Copy full SHA for d7cf4db - Browse repository at this point
Copy the full SHA d7cf4dbView commit details -
Correctly calculate serialized enum style for serialization
Changes in serialization (see the file attached to PR): ExternallyTagged, Untagged, Mixed: Tuple0: tuple(0) -> unit Tuple2as0: tuple(0) -> unit Tuple2as1: tuple(1) -> newtype Tuple2as0Default: tuple(0) -> unit Tuple2as1Default: tuple(1) -> newtype Tuple2as0With: tuple(0) -> unit Tuple2as1With: tuple(1) -> newtype AdjacentlyTagged: Tuple0: { tag, content: tuple(0) } -> { tag } Tuple2as0: { tag, content: tuple(0) } -> { tag } Tuple2as1: { tag, content: tuple(1) } -> { tag, content: newtype } Tuple2as0Default: { tag, content: tuple(0) } -> { tag } Tuple2as1Default: { tag, content: tuple(1) } -> { tag, content: newtype } Tuple2as0With: { tag, content: tuple(0) } -> { tag } Tuple2as1With: { tag, content: tuple(1) } -> { tag, content: newtype }
Configuration menu - View commit details
-
Copy full SHA for d6b1cc2 - Browse repository at this point
Copy the full SHA d6b1cc2View commit details -
Correctly construct tuples with permanently skipped fields
Does not change anything in the generated code, but the new code will correctly process tuples, when serialization style would compute correctly
Configuration menu - View commit details
-
Copy full SHA for 64357d3 - Browse repository at this point
Copy the full SHA 64357d3View commit details -
Correctly construct newtypes with permanently skipped fields
Changes in deserialization of all enums, except externally tagged (see the file attached to PR): no changes in logic, only some additional type hints that would required by the next commit
Configuration menu - View commit details
-
Copy full SHA for 600ded8 - Browse repository at this point
Copy the full SHA 600ded8View commit details -
Correctly calculate serialized enum style for deserialization
Changes in generated code (see the file attached to PR): AdjacentlyTagged, Untagged, Mixed: Tuple0: tuple(0) -> unit Tuple2as0: tuple(0) -> unit Tuple2as1: tuple(1) -> newtype Tuple2as0Default: tuple(0) -> unit Tuple2as1Default: tuple(1) -> newtype Tuple2as0With: tuple(0) -> unit Tuple2as1With: tuple(1) -> newtype
Configuration menu - View commit details
-
Copy full SHA for 5f7d386 - Browse repository at this point
Copy the full SHA 5f7d386View commit details -
Add tests for using visit_seq for deserialzation struct variants of a…
…djacently tagged and untagged enums serde-rs#2465 maked such deserialization possible
Configuration menu - View commit details
-
Copy full SHA for 61121b9 - Browse repository at this point
Copy the full SHA 61121b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for badba24 - Browse repository at this point
Copy the full SHA badba24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20a391d - Browse repository at this point
Copy the full SHA 20a391dView commit details