-
Notifications
You must be signed in to change notification settings - Fork 742
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 31, 2023
-
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 bbc2bf8 - Browse repository at this point
Copy the full SHA bbc2bf8View 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 f7b6944 - Browse repository at this point
Copy the full SHA f7b6944View 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 2a975fd - Browse repository at this point
Copy the full SHA 2a975fdView 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 b812de8 - Browse repository at this point
Copy the full SHA b812de8View 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 a6a2c82 - Browse repository at this point
Copy the full SHA a6a2c82View 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 654ea6d - Browse repository at this point
Copy the full SHA 654ea6dView commit details -
Change Tuple2as1(Skipped, x) representation: tuple(1) -> newtype
This matches the Tuple1(x) behavior which should be used Fixed (1): tuple_struct::tuple2as1 Changes in generated code (see the file attached to PR): Tuple2as1: Tuple2as1Default: Tuple2as1With: *_tuple_struct(1) -> *_newtype_struct
Configuration menu - View commit details
-
Copy full SHA for 1eac41c - Browse repository at this point
Copy the full SHA 1eac41cView 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 b3e8da3 - Browse repository at this point
Copy the full SHA b3e8da3View 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 f92623c - Browse repository at this point
Copy the full SHA f92623cView commit details -
Correctly serialize 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 47e031c - Browse repository at this point
Copy the full SHA 47e031cView 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 ff1e64b - Browse repository at this point
Copy the full SHA ff1e64bView 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 09366b3 - Browse repository at this point
Copy the full SHA 09366b3View 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 93fb53a - Browse repository at this point
Copy the full SHA 93fb53aView 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 32f2c49 - Browse repository at this point
Copy the full SHA 32f2c49View 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 4647c19 - Browse repository at this point
Copy the full SHA 4647c19View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c8fa03 - Browse repository at this point
Copy the full SHA 0c8fa03View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77b3293 - Browse repository at this point
Copy the full SHA 77b3293View commit details