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
bindgen 0.73.2 requires prettyplease >=0.2.7 but needs >=0.3 (syn 3) to compile #3551
But bindgen's own code calls syn::parse_quote!() to build a syn::File
before handing it to prettyplease::unparse(). This only compiles when
both syn and prettyplease resolve to the matching major line (syn 2
with prettyplease <0.3, or syn 3 with prettyplease >=0.3) — prettyplease
switched to syn 3 starting at 0.3.0.
In a workspace where several crates depend on different versions of
bindgen (e.g. an old transitive dependency pinned to bindgen "^0.70" or
"^0.71", and a direct dependency on bindgen "^0.73" via skia-bindings),
cargo may unify syn and/or prettyplease to a version that satisfies
every stated range on paper, but mismatches what bindgen 0.73.2 actually
needs. The result is:
error[E0277]: the trait bound syn::file::File: syn::parse_quote::ParseQuote is not satisfied
--> bindgen-0.73.2/lib.rs:1017:50
|
1017 | return Ok(prettyplease::unparse(&syn::parse_quo
Minimal repro: a workspace with two bindgen consumers, one requiring
"^0.71" (pulls prettyplease 0.2.x transitively) and one requiring
"^0.73" (via skia-bindings 0.156.0), with no other constraint forcing a
split. cargo resolves a single shared prettyplease/syn pair that
satisfies both ranges on paper (prettyplease 0.2.37 + syn 2.0.x), which
fails to compile bindgen 0.73.2's own code.
Workaround confirmed to fix it: raising bindgen's own manifest floors to syn = ">=3, <4" and prettyplease = ">=0.3, <0.4" lets cargo resolve a
separate syn-3/prettyplease-0.3 pair for the 0.73.x edge while leaving
older bindgen consumers on syn 2/prettyplease 0.2.x. Could bindgen 0.73.x
(or whichever version first required syn 3 internally) raise these
floors in its own Cargo.toml so downstream workspaces don't need a
patched mirror to get a consistent syn/prettyplease pair?
Activity
Update Cargo.lock