Skip to content
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 generation of non-existent lifetime 'de when enum contains a #[serde(flatten)] field and a 'static reference #2383

Merged
merged 2 commits into from Mar 8, 2023

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented Feb 25, 2023

New test_gen tests prevents future regressions.

Fixes #2371.

Mingun and others added 2 commits February 27, 2023 21:03
This function is called for untagged, internally and externally tagged enums,
but `deserializer` parameter is `None` only for the latest. Only when it's `None`
`DeserializeSeed` impl is used
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay dtolnay merged commit 0750eee into serde-rs:master Mar 8, 2023
19 checks passed
@Mingun Mingun deleted the fix-flatten+static branch March 8, 2023 20:12
crapStone added a commit to Calciumdibromid/CaBr2 that referenced this pull request Mar 15, 2023
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 ([#&#8203;2374](serde-rs/serde#2374), thanks [@&#8203;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 ([#&#8203;2383](serde-rs/serde#2383), thanks [@&#8203;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 ([#&#8203;2387](serde-rs/serde#2387), thanks [@&#8203;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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

"undeclared lifetime" when derive Deserialize for an enum with both flatten and 'static fields
2 participants