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

Regression in serde 1.0.157 when a proc macro enables syn's full feature #2409

Closed
nox opened this issue Mar 20, 2023 · 1 comment · Fixed by #2410
Closed

Regression in serde 1.0.157 when a proc macro enables syn's full feature #2409

nox opened this issue Mar 20, 2023 · 1 comment · Fixed by #2410

Comments

@nox
Copy link
Contributor

nox commented Mar 20, 2023

With https://github.com/nox/serde-none-group, the command cargo build --features syn-full fails while the command cargo build succeeds. The only difference is that the failing command enables the "full" feature of the crate syn from a proc macro.

The build failure is:

± cargo build --features syn-full
   Compiling syn v2.0.2
   Compiling serde_derive v1.0.157
   Compiling another-proc-macro v0.1.67 (/Users/nox/src/serde-none-group/another-proc-macro)
   Compiling serde v1.0.157
   Compiling serde-none-group v0.1.0 (/Users/nox/src/serde-none-group)
error: expected serde crate attribute to be a string: `crate = "..."`
  --> src/lib.rs:4:25
   |
4  |           #[serde(crate = $serde_path)]
   |                           ^^^^^^^^^^^
...
9  | / bug_if_async_trait! {
10 | |     "serde"
11 | | }
   | |_- in this macro invocation
   |
   = note: this error originates in the macro `bug_if_async_trait` (in Nightly builds, run with -Z macro-backtrace for more info)

I've debugged it and the reason is that serde_derive sees a None-delimited group instead of a bare literal, but only when the "full" feature of syn is enabled.

@dtolnay
Copy link
Member

dtolnay commented Mar 20, 2023

Sorry about the breakage, this is fixed in serde_derive 1.0.158.

crapStone added a commit to Calciumdibromid/CaBr2 that referenced this issue Mar 30, 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.156` -> `1.0.159` |

---

### Release Notes

<details>
<summary>serde-rs/serde</summary>

### [`v1.0.159`](https://github.com/serde-rs/serde/releases/tag/v1.0.159)

[Compare Source](serde-rs/serde@v1.0.158...v1.0.159)

-   Accept empty #\[serde()] attribute ([#&#8203;2422](serde-rs/serde#2422))

### [`v1.0.158`](https://github.com/serde-rs/serde/releases/tag/v1.0.158)

[Compare Source](serde-rs/serde@v1.0.157...v1.0.158)

-   Fix *"expected serde crate attribute to be a string"* error when using macro_rules metavariable inside of serde attribute: `#[serde(crate = $serde_path)]` ([#&#8203;2409](serde-rs/serde#2409))

### [`v1.0.157`](https://github.com/serde-rs/serde/releases/tag/v1.0.157)

[Compare Source](serde-rs/serde@v1.0.156...v1.0.157)

-   Update syn dependency to 2.x

</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:eyJjcmVhdGVkSW5WZXIiOiIzNS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzUuMjQuMiJ9-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Co-authored-by: crapStone <crapstone01@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1829
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 a pull request may close this issue.

2 participants