Skip to content

Update workspace dependencies and bump MSRV to 1.85 - #3433

Closed
tagawa0525 wants to merge 5 commits into
rust-lang:mainfrom
tagawa0525:update-dependencies
Closed

Update workspace dependencies and bump MSRV to 1.85#3433
tagawa0525 wants to merge 5 commits into
rust-lang:mainfrom
tagawa0525:update-dependencies

Conversation

@tagawa0525

@tagawa0525 tagawa0525 commented Aug 15, 2026

Copy link
Copy Markdown

Motivation

I ran into this while trying to move a downstream crate that generates --dynamic-loading bindings at build time (waypipe) to libloading 0.9. bindgen master already 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 msrv job failed against 1.71 (thanks @xtqqczze). Rather than pin everything back, this PR bumps rust-version to 1.85 (edition 2024 release, February 2025) and documents it in README.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

  • Bump [workspace.dependencies] to their latest versions compatible with Rust 1.85 and refresh Cargo.lock.
  • 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(), and title/footer composition now goes through Group. Snippets set fold(false) to keep showing unannotated source lines as before. Verified the rendered output of --experimental --emit-diagnostics (invalid-regex warning) still displays correctly.
  • quickcheck 1.1: QuickCheck::gen is deprecated (gen is a Rust 2024 keyword) → use QuickCheck::rng.
  • Remaining updates (env_logger 0.11, similar 3, clap 4.6, etc.) needed no code changes; a follow-up commit fixes the clippy warnings surfaced by the updates (implicit_clone in diagnostics.rs, doc_markdown in regex_set.rs).
  • MSRV 1.71 → 1.85: Cargo.toml, README.md, CHANGELOG.md.

Test

Locally with the 1.85 toolchain, matching the CI msrv job: cargo +1.85 test --package bindgen and cargo +1.85 build --package bindgen-cli pass. cargo test results 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.

tagawa0525 and others added 2 commits August 14, 2026 01:18
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
Copilot AI lite review requested due to automatic review settings August 15, 2026 05:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 refresh Cargo.lock accordingly.
  • Port the diagnostics rendering pipeline to annotate-snippets 0.12’s Group/Snippet API and update Level usages to the new const-based API.
  • Update the quickcheck-based test harness to use QuickCheck::rng (replacing deprecated QuickCheck::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.

@xtqqczze

Copy link
Copy Markdown
Contributor

fails msrv check

tagawa0525 and others added 3 commits August 29, 2026 22:27
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
@tagawa0525 tagawa0525 changed the title Update workspace dependencies Update workspace dependencies and bump MSRV to 1.85 Aug 29, 2026
@tagawa0525

Copy link
Copy Markdown
Author

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 rust-version between 1.77 and 1.85, so this can't pass with MSRV 1.71.

I've pushed a bump of rust-version to 1.85 (README/CHANGELOG updated, plus the clippy lints that this newly enables), and kept libloading at 0.8.9 since 0.9.0 wants 1.88. I also added the motivation to the PR description. Whether an MSRV bump is acceptable at this point is up to the maintainers — if 1.71 needs to stay, feel free to close this and I'll revisit once the MSRV moves.

@tagawa0525

Copy link
Copy Markdown
Author

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 --dynamic-loading output — is already on master (#3315) and just needs a release (#3333). Happy to revisit if/when the MSRV moves.

@tagawa0525 tagawa0525 closed this Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants