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
Make #[serde(alias)] works in #[serde(flatten)] context #2387
Conversation
Please also add a few tests for a struct like the one from the issue. |
Added in 01da3f7 |
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.
Thanks!
In #2160 (review) I was hopeful that somebody would look into what possibility of breakage this has for existing formats, but in the absence of anyone having been willing to do that, I think it will be all right to reassess based on any reported consequences.
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [serde](https://serde.rs) ([source](https://github.com/serde-rs/serde)) | dependencies | patch | `1.0.152` -> `1.0.156` | --- ### Release Notes <details> <summary>serde-rs/serde</summary> ### [`v1.0.156`](https://github.com/serde-rs/serde/releases/tag/v1.0.156) [Compare Source](serde-rs/serde@v1.0.155...v1.0.156) - Documentation improvements ### [`v1.0.155`](https://github.com/serde-rs/serde/releases/tag/v1.0.155) [Compare Source](serde-rs/serde@v1.0.154...v1.0.155) - Support `Serialize` and `Deserialize` impls for `core::ffi::CStr` and `alloc::ffi::CString` without "std" feature ([#​2374](serde-rs/serde#2374), thanks [@​safarir](https://github.com/safarir)) ### [`v1.0.154`](https://github.com/serde-rs/serde/releases/tag/v1.0.154) [Compare Source](serde-rs/serde@v1.0.153...v1.0.154) - Fix "undeclared lifetime" error in generated code when deriving Deserialize for an enum with both `flatten` and `'static` fields ([#​2383](serde-rs/serde#2383), thanks [@​Mingun](https://github.com/Mingun)) ### [`v1.0.153`](https://github.com/serde-rs/serde/releases/tag/v1.0.153) [Compare Source](serde-rs/serde@v1.0.152...v1.0.153) - Support `serde(alias = "…")` attribute used inside of flattened struct ([#​2387](serde-rs/serde#2387), thanks [@​bebecue](https://github.com/bebecue)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTcuMSIsInVwZGF0ZWRJblZlciI6IjM1LjIuMyJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Co-authored-by: crapStone <crapstone01@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1812 Reviewed-by: crapStone <crapstone@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Simplify code in deserialize_in_place_struct and implement #2387 for in-place case
I know I'm well and truly late to the party hahah but this change did break some of our code. At a high level you can see the issue like this:
With 1.0.152 this code works without error. I tried the latest version of serde (1.0.188 at the time of writing) and the issue seems to persist. I'm still trying to figure out how this change actually breaks our code, I just wanted to report in with an instance of a breakage. Once I know precisely what it changes for us I'll chime in again, though this looks pretty complicated. |
btw I looked into some issues in this repo. I know serde complies with semver but I also know that that only applies to public APIs, so I'm not 100% sure if this qualifies as a breaking change. I'll try figure that out and open a new issue if so. |
Moving to this issue now: #2627. |
fix #1504