You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
syn dependency version bound is incompatible with prettyplease #3448
I have the following build dependencies in my crate:
bindgen = "0.73.1"cmake = "0.1.58"
The syn version bound in bindgen (>=2, <4) allows Cargo to select a 2.x release (2.0.119) for bindgen and a 3.x release (3.0.3) for prettyplease, which causes a compilation error. Why cargo picks an old syn release for bindgen is beyond me.
This is one of those cases where I just shut my computer off and go do something else, because it is 11pm and I do not feel like spending the rest of my Saturday night hitting cargo with a rock until it does the right thing.
Reacted by Oscar Gustafsson, ben, Jelmer Vernooij and paullegranddc
It seems to only happen in my workspace because when I tried making a testcase it doesn't happen. My current workaround is to run cargo update --ignore-rust-version, but running cargo add breaks it again. My rustc version is rustc 1.96.0-nightly (b90dc1e59 2026-03-04).
I don't think it's reasonable to expect Cargo's resolver to match up the prettyplease version with the one used by syn necessarily, when another version of bindgen is using old syn + prettyplease. The open PR looks like a proper fix to me:
Another real-world hit, in case it helps with the missing test case: a Renovate bump of bindgen 0.72.1 to 0.73.2 in a workspace whose lockfile already had prettyplease 0.2.37 and a syn 3 dependency elsewhere. bindgen 0.73.2 resolved to syn 3.0.5 but kept prettyplease 0.2.37, which uses syn 2, and failed with the trait bound syn::file::File: syn::parse_quote::ParseQuote is not satisfied.
I could not reduce it to a minimal project. A fresh resolve, and adding 0.73.2 next to 0.72.1 in an existing lock (with or without a direct syn = "3"), both gave a consistent pairing. It needs an existing lock entry plus syn 3 pulled in by another crate.
cargo update -p prettyplease fixed it by adding prettyplease 0.3.0 next to 0.2.37. Agree with the comment above: #3506 looks like the proper fix.
I came across this again when updating rustls-webpki and webpki-root-certs. It's likely others will come across the same issue too, especially with the recent CVEs that were released.
Specifically, have a Cargo.toml file like so:
[package]
name = "ex"version = "0.1.0"edition = "2024"
[dependencies]
bindgen = "=0.73.2"syn = "=2.0.119"rustls-webpki = { version = "=0.103.16", default-features = false }
webpki-root-certs = "=1.0.10"rustls-pki-types = { version = "=1.15.1", features = ["web"] }
Activity
emilio commentedon Sep 6, 2026
I'm confused, it should allow getting syn 3 right?
A minimal test-case would be good, because I just created a directory with those dependencies and I can't reproduce.
ds84182 commentedon Sep 7, 2026
It seems to only happen in my workspace because when I tried making a testcase it doesn't happen. My current workaround is to run
cargo update --ignore-rust-version, but runningcargo addbreaks it again. My rustc version isrustc 1.96.0-nightly (b90dc1e59 2026-03-04).emilio commentedon Sep 7, 2026
Seems like this should move upstream?
chore(deps): cascade prettyplease 0.2.37 → 0.3.0 for bindgen 0.73.2
chore(deps): update rust crate bindgen to v0.73.2 (#43)
djc commentedon Oct 4, 2026
I don't think it's reasonable to expect Cargo's resolver to match up the prettyplease version with the one used by syn necessarily, when another version of bindgen is using old syn + prettyplease. The open PR looks like a proper fix to me:
The current "parallel ranges" approach just seems broken.
build(sapi): turn off the default features of bindgen
Disable unused bindgen default features
austek commentedon Oct 12, 2026
Another real-world hit, in case it helps with the missing test case: a Renovate bump of bindgen 0.72.1 to 0.73.2 in a workspace whose lockfile already had prettyplease 0.2.37 and a syn 3 dependency elsewhere. bindgen 0.73.2 resolved to syn 3.0.5 but kept prettyplease 0.2.37, which uses syn 2, and failed with
the trait bound syn::file::File: syn::parse_quote::ParseQuote is not satisfied.I could not reduce it to a minimal project. A fresh resolve, and adding 0.73.2 next to 0.72.1 in an existing lock (with or without a direct
syn = "3"), both gave a consistent pairing. It needs an existing lock entry plus syn 3 pulled in by another crate.cargo update -p prettypleasefixed it by adding prettyplease 0.3.0 next to 0.2.37. Agree with the comment above: #3506 looks like the proper fix.Disable unused bindgen default features
Use bindgen that fixes codegen for `YGUndefined` (#62)
renovate: ignore prettyplease
renovate: ignore prettyplease
Upgrade comrak to 0.56, rustyline to 19, and zip to 9
chore: go back to bindgen 0.72
ettolrach commentedon Oct 21, 2026
I came across this again when updating rustls-webpki and webpki-root-certs. It's likely others will come across the same issue too, especially with the recent CVEs that were released.
Specifically, have a Cargo.toml file like so:
then run the following commands.
cargo generate-lockfile cargo check --locked cargo update rustls-webpki && cargo update webpki-root-certs cargo check --lockedIt can be fixed by then running
cargo update bindgen.It's ultimately caused by rust-lang/cargo#13942 but I think it should still be fixed in bindgen.
xtqqczze commentedon Oct 28, 2026
I just encountered this issue with
bindgenas a transitive dependency. Manually updatingprettypleasealso resolved it for me.chore(deps): keep prettyplease at 0.2 so the release PR's fips check …
chore(deps): pair bindgen's prettyplease with syn 3
chore(deps): unpin prettyplease so dependency review passes again (#3883
chore(deps): fix the release PR's fips check, which #3883 broke (#3890)