Update workspace dependencies and bump MSRV to 1.85 - #3433
Conversation
Pin all workspace dependencies to their latest versions, notably: - annotate-snippets 0.11 -> 0.12: port diagnostics.rs to the new Group/Element API (Level enum variants became consts with a lifetime parameter, Snippet::origin() became path(), title/footer composition now goes through Group). Snippets set fold(false) to keep showing unannotated source lines as before. - libloading 0.8 -> 0.9: no code changes needed; the dyngen template already passes &OsStr to Library::new (5813198), which satisfies libloading 0.9's AsFilename bound. The generated dynamic_loading_* expectations compile against 0.9 unchanged. - env_logger 0.10 -> 0.11, similar 2 -> 3: no code changes needed. cargo test results are unchanged from before this commit: the two failing expectation tests (issue-544-stylo-creduce-2, nsbasehashtable) also fail on the unmodified tree with libclang 21 and are unrelated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TwjQ7wD6uxpJMX6jzPRj9K
- diagnostics.rs: annotate-snippets 0.12's render() returns String directly, so the to_string() call became an implicit clone (clippy::implicit_clone); iterate over the String's lines directly. - quickchecking: quickcheck 1.1 deprecated QuickCheck::gen in favor of QuickCheck::rng. - regex_set.rs: add missing backticks in a doc comment (clippy::doc_markdown). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TwjQ7wD6uxpJMX6jzPRj9K
There was a problem hiding this comment.
Pull request overview
Updates the workspace’s pinned dependency versions and adjusts bindgen’s code to accommodate upstream API changes (notably annotate-snippets and quickcheck), keeping diagnostic output and tests functioning under the new dependency set.
Changes:
- Bump and re-pin
[workspace.dependencies]to newer crate versions and refreshCargo.lockaccordingly. - Port the diagnostics rendering pipeline to
annotate-snippets0.12’sGroup/SnippetAPI and updateLevelusages to the new const-based API. - Update the quickcheck-based test harness to use
QuickCheck::rng(replacing deprecatedQuickCheck::gen).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updates workspace dependency pins to newer versions. |
| Cargo.lock | Refreshes the resolved dependency graph/checksums after version bumps. |
| bindgen/regex_set.rs | Updates doc comment formatting and Level::* usages for diagnostics. |
| bindgen/lib.rs | Updates diagnostic emission to use the new Level::* consts. |
| bindgen/ir/var.rs | Updates diagnostic Level usage to the new API. |
| bindgen/ir/context.rs | Updates diagnostic Level usage to the new API. |
| bindgen/diagnostics.rs | Ports diagnostics rendering to annotate-snippets 0.12 Group/Snippet API. |
| bindgen/codegen/mod.rs | Updates diagnostic Level usage to the new API. |
| bindgen-tests/tests/quickchecking/src/lib.rs | Switches from deprecated QuickCheck::gen to QuickCheck::rng. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
fails msrv check |
libloading 0.9.0 declares rust-version = 1.88, which is above the MSRV this branch moves to. The crate is only used by the expectations test crate, and the generated dyngen code (5813198) is compatible with both 0.8 and 0.9, so nothing is lost by staying on 0.8.9. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwZopBunmYL9qDWkaUNHQW
The updated workspace dependencies (annotate-snippets 0.12, clap 4.6, quickcheck 1.1, similar 3, owo-colors 4.3, rustc-hash 2.1.3, ...) require rustc 1.77 to 1.85, so the msrv CI job fails against 1.71. Raise rust-version to 1.85 and document it in README and CHANGELOG. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwZopBunmYL9qDWkaUNHQW
Clippy gates several lints on rust-version; raising it to 1.85 turns these on under the CI's -D warnings: - ref_as_ptr: use `&raw const` / `&raw mut` instead of coercing references to raw pointers - io_other_error: `io::Error::other(..)` instead of `io::Error::new(io::ErrorKind::Other, ..)` - unnecessary_map_or: `Option::is_none_or` instead of `map_or(true, ..)` Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwZopBunmYL9qDWkaUNHQW
|
Thanks — right, most of the updated crates (annotate-snippets 0.12, clap 4.6, quickcheck 1.1, similar 3, owo-colors 4.3, rustc-hash 2.1.3) declare I've pushed a bump of |
|
Closing this: on reflection the dependency refresh isn't something bindgen needs right now, and an MSRV jump from 1.71 to 1.85 without a concrete driver doesn't fit how this project has bumped MSRV so far (only when a required dependency demands it). The actual need behind this — libloading 0.9-compatible |
Motivation
I ran into this while trying to move a downstream crate that generates
--dynamic-loadingbindings at build time (waypipe) to libloading 0.9. bindgenmasteralready handles that (5813198 / #3315, not yet released — see #3333), and while checking that on a fork I also bumped the rest of the workspace dependencies to see what would break. This PR is the result of that experiment; it is a general dependency refresh rather than something bindgen strictly needs right now.MSRV: most of the updated crates (annotate-snippets 0.12, clap 4.6, quickcheck 1.1, similar 3, owo-colors 4.3, rustc-hash 2.1.3) require Rust ≥ 1.77–1.85, so the CI
msrvjob failed against 1.71 (thanks @xtqqczze). Rather than pin everything back, this PR bumpsrust-versionto 1.85 (edition 2024 release, February 2025) and documents it inREADME.md/CHANGELOG.md. libloading stays at 0.8.9 because 0.9.0 requires Rust 1.88; the generated code is compatible with both anyway.Whether an MSRV bump is acceptable is a maintainer decision — if 1.71 must stay, I'm fine with closing this and revisiting when the MSRV moves.
Changes
[workspace.dependencies]to their latest versions compatible with Rust 1.85 and refreshCargo.lock.diagnostics.rsto the newGroup/ElementAPI.Levelenum variants became consts with a lifetime parameter,Snippet::origin()becamepath(), and title/footer composition now goes throughGroup. Snippets setfold(false)to keep showing unannotated source lines as before. Verified the rendered output of--experimental --emit-diagnostics(invalid-regex warning) still displays correctly.QuickCheck::genis deprecated (genis a Rust 2024 keyword) → useQuickCheck::rng.implicit_clonein diagnostics.rs,doc_markdownin regex_set.rs).Cargo.toml,README.md,CHANGELOG.md.Test
Locally with the 1.85 toolchain, matching the CI
msrvjob:cargo +1.85 test --package bindgenandcargo +1.85 build --package bindgen-clipass.cargo testresults are otherwise unchanged from the unmodified tree: the two expectation tests failing locally (issue-544-stylo-creduce-2, nsbasehashtable) also fail on clean main with libclang 21 and are unrelated to this change.