Skip to content

THRIFT-6162: Require Rust 1.85 with the 2024 edition and build with Rust 1.99 - #4003

Merged
Jens-G merged 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6162
Oct 14, 2026
Merged

Jens-G merged 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6162

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Moves the Rust crates to the 2024 edition with rust-version = "1.85", and pins CI, release and Docker to Rust 1.99.0. The pin is not stable because clippy runs with -D warnings. The generator change replaces is_some()/unwrap() in ok_or(), which clippy 1.99 rejects in every generated client. This makes the .cargo/config.toml from #4002 redundant.

Verified: lib-rust CI steps on 1.85.1 and 1.99.0 → pass; rs↔rs cross test → 0 of 48 failed.

…ust 1.99

Client: rs

All Rust crates declare edition 2024 and rust-version 1.85. Edition 2024
turns on Cargo's MSRV-aware resolver, so dependencies resolve to versions
that still build on 1.85 even when a newer toolchain runs the build.

CI, the crates.io release and the Docker images use Rust 1.99.0, pinned
rather than "stable": the Rust jobs run clippy with -D warnings, and each
new release adds lints. Bump the pin on purpose, together with any lint
fixes it needs.

The generated ok_or() now matches with if-let instead of is_some() and
unwrap(), which clippy 1.99 rejects in every generated client.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 20:50
@mergeable mergeable Bot added rust Pull requests that update Rust code compiler build and general CI cmake, automake and build system changes labels Oct 12, 2026
@mergeable mergeable Bot added the github_actions Pull requests that update GitHub Actions code label Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The edition migration misses the new gen keyword, and CI no longer validates the declared Rust 1.85 minimum.

2 open findings
What changed in this PR

Raises Rust support to edition 2024 with Rust 1.85 as the minimum, while pinning builds and releases to Rust 1.99.

Changes:

  • Updates Rust crates, compatibility documentation, and configure checks.
  • Pins CI, release workflows, and Docker images to Rust 1.99.
  • Updates generated and handwritten Rust code for current clippy/rustfmt behavior.
File Description
tutorial/​rs/​src/​bin/​tutorial_server.rs Refactors optional operand handling.
tutorial/​rs/​Cargo.toml Sets edition 2024 and Rust 1.85.
test/​rs/​src/​bin/​test_server.rs Applies clippy and import cleanups.
test/​rs/​src/​bin/​test_client.rs Applies clippy and import cleanups.
test/​rs/​Cargo.toml Sets edition 2024 and Rust 1.85.
rust-toolchain Pins Rust 1.99.0.
lib/​rs/​tests/​tls.rs Reorders imports.
lib/​rs/​tests/​shared_channel.rs Reorders imports.
lib/​rs/​test/​fuzz/​fuzz_targets/​roundtrip_compact.rs Reorders imports.
lib/​rs/​test/​fuzz/​fuzz_targets/​roundtrip_binary.rs Reorders imports.
lib/​rs/​test/​fuzz/​fuzz_targets/​parse_compact.rs Reorders imports.
lib/​rs/​test/​fuzz/​fuzz_targets/​parse_binary.rs Reorders imports.
lib/​rs/​test/​fuzz/​Cargo.toml Sets edition 2024 and Rust 1.85.
lib/​rs/​test/​Cargo.toml Sets edition 2024 and Rust 1.85.
lib/​rs/​test_recursive/​src/​lib.rs Reorders imports.
lib/​rs/​test_recursive/​Cargo.toml Sets edition 2024 and Rust 1.85.
lib/​rs/​src/​transport/​tls.rs Reorders imports.
lib/​rs/​src/​transport/​socket.rs Reorders imports.
lib/​rs/​src/​server/​multiplexed.rs Applies formatting and clippy fixes.
lib/​rs/​src/​server/​mod.rs Applies Rust 1.99 formatting.
lib/​rs/​src/​protocol/​mod.rs Removes needless borrowing and reformats.
lib/​rs/​src/​protocol/​compact.rs Applies Rust 1.99 formatting.
lib/​rs/​src/​protocol/​binary.rs Applies formatting and clippy fixes.
lib/​rs/​README.md Documents the new Rust compatibility policy.
lib/​rs/​Cargo.toml Sets edition 2024 and Rust 1.85.
LANGUAGES.md Updates supported and tested Rust versions.
doc/​thrift-threat-model.md Updates the documented Rust baseline.
configure.ac Requires rustc 1.85 or newer.
compiler/​cpp/​src/​thrift/​generate/​t_rs_generator.cc Replaces generated unwraps with pattern matching.
build/​docker/​ubuntu-noble/​Dockerfile Installs Rust 1.99.0.
build/​docker/​ubuntu-jammy/​Dockerfile Installs Rust 1.99.0.
build/​docker/​README.md Documents the Docker Rust version.
.github/​workflows/​release_rust.yml Pins publishing to Rust 1.99.0.
.github/​workflows/​build.yml Pins Rust CI to 1.99.0.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/rs/Cargo.toml
name = "thrift"
description = "Rust bindings for the Apache Thrift RPC system"
edition = "2021"
edition = "2024"
timeout-minutes: 60
env:
TOOLCHAIN_VERSION: 1.85.1
TOOLCHAIN_VERSION: 1.99.0
@Jens-G
Jens-G merged commit b3c9597 into apache:master Oct 14, 2026
112 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build and general CI cmake, automake and build system changes compiler github_actions Pull requests that update GitHub Actions code rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants