-
-
Notifications
You must be signed in to change notification settings - Fork 786
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
Correctly process flatten fields in enum variants #2567
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@dtolnay , when you could look at this? This bugs becomes annoying... |
Mingun
force-pushed
the
fix-2565
branch
2 times, most recently
from
July 23, 2024 17:56
cfde011
to
2b88ec0
Compare
failures (1): regression::issue2565::simple_variant
Currently panics in derive: error: proc-macro derive panicked --> test_suite\tests\test_annotations.rs:2386:25 | 2386 | #[derive(Serialize, Deserialize, PartialEq, Debug)] | ^^^^^^^^^^^ | = help: message: assertion failed: !cattrs.has_flatten() error: proc-macro derive panicked --> test_suite\tests\regression\issue1904.rs:57:10 | 57 | #[derive(Deserialize)] | ^^^^^^^^^^^ | = help: message: assertion failed: !cattrs.has_flatten() error: proc-macro derive panicked --> test_suite\tests\regression\issue1904.rs:47:10 | 47 | #[derive(Deserialize)] | ^^^^^^^^^^^ | = help: message: assertion failed: !cattrs.has_flatten() error: proc-macro derive panicked --> test_suite\tests\regression\issue1904.rs:37:10 | 37 | #[derive(Deserialize)] | ^^^^^^^^^^^ | = help: message: assertion failed: !cattrs.has_flatten() error: proc-macro derive panicked --> test_suite\tests\regression\issue1904.rs:27:10 | 27 | #[derive(Deserialize)] | ^^^^^^^^^^^ | = help: message: assertion failed: !cattrs.has_flatten() error: proc-macro derive panicked --> test_suite\tests\regression\issue1904.rs:16:10 | 16 | #[derive(Deserialize)] | ^^^^^^^^^^^ | = help: message: assertion failed: !cattrs.has_flatten() error: proc-macro derive panicked --> test_suite\tests\regression\issue1904.rs:7:10 | 7 | #[derive(Deserialize)] | ^^^^^^^^^^^ | = help: message: assertion failed: !cattrs.has_flatten()
- Fix incorrect deserialization of variants that doesn't contain flatten field when other contains - Fix a panic when deriving `Deserialize` for an enum with tuple and struct with flatten field Fixes (2): regression::issue2565::simple_variant regression::issue1904 (compilation)
dtolnay
approved these changes
Aug 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Store
has_flatten
mark in theVariant
attributes and use it instead ofattr::Container::has_flatten()
in methods that can be called for variants.Fixes #1904, fixes #2565, fixes #2792