Rust 1.96.0 shipped on May 28, 2025. This release focuses on stability and security. It includes backend improvements, bug fixes, and two important CVE patches. The rust 1.96.0 release notes also stabilize several APIs like assert_matches! and introduce new Cargo features for git and registry handling.
This maintenance release is recommended for all Rust developers. It fixes two CVEs in Cargo and brings compatibility changes that may affect cross-compilation workflows. Upgrade to keep your toolchain secure and aligned with the latest Rust standards.
What Changed
- Stabilized APIs:
assert_matches!,debug_assert_matches!,From<T> for AssertUnwindSafe<T>,From<T> for LazyCell<T, F>,From<T> for LazyLock<T, F>, and several newcore::rangetypes. - Language: Allow passing expr metavariable to
cfg, always coerce never types in tuple expressions, support s390x vector registers in inline assembly, and allow constants of typeManuallyDropas patterns (fixing a regression from 1.94.0). - Compiler: Enable link relaxation for LoongArch Linux, update riscv64gc-unknown-fuchsia baseline to RVA22 + vector.
- Libraries: Support iterating over ranges of
NonZerointegers, refactor valid-for-read/write definition to exclude null, fix SGX delayed host lookup viaToSocketAddr. - Cargo: Allow a dependency to specify both a git repository and an alternate registry. Added
target.'cfg(..)'.rustdocflagssupport. Fixed CVE-2026-5222 and CVE-2026-5223. - Rustdoc: Deprecation notes now render like other docs (using standard markdown). Separate methods and associated functions in the sidebar.
- Compatibility: Fix layout of
#[repr(Int)]enums with uninhabited ZSTs, prevent unsize-coercing intoPin<Foo>withoutDeref, stop passing--allow-undefinedon wasm targets, gate accidentally stabilized#![reexport_test_harness_main], error on too-private RPITITs, reportuninhabited_staticlint in dependencies, distributed builds now include non-split debuginfo for windows-gnu, remove-Csoft-float, update minimum external LLVM to 21, and changec_doubletof32on AVR targets.
Why It Matters
- Maintenance release with no specific user-facing features documented. The focus is on stability and security.
Who Should Upgrade
This release is particularly relevant for Rust developers working on cross-compilation (LoongArch, Fuchsia, AVR) or using inline assembly on s390x. Teams managing Cargo registries or depending on CVE-free tooling should update immediately. Anyone using #[repr(Int)] enums or Pin ergonomics will benefit from the bug fixes.
How to Upgrade
- Update your Rust toolchain using rustup:
rustup update stable. - Verify the new version:
rustc --versionshould returnrustc 1.96.0. - Check for any compatibility warnings in your projects, especially if you use wasm targets, AVR, or custom LLVM configurations.
- Review the full release notes for breaking changes related to
c_doubleon AVR or import syntax changes. - For Cargo users, ensure your registry configurations handle the new git+registry support if needed.
Usage Examples
- assert_matches! macro: Use the newly stabilized macro for concise match-based assertions in tests. Example:
assert_matches!(result, Ok(value)). - NonZero range iteration: Iterate over
NonZeroU8from 1 to 255. No need to unwrap or filter zeros manually. - Cargo dual git/registry: Specify both a git repository and an alternate registry in your
Cargo.toml. The git version works locally; the registry version is used on publish. - Rustdoc sidebar changes: Methods and associated functions now appear separately, improving navigation in generated docs.
- LazyCell / LazyLock: Use
From<T>to initialize aLazyCelldirectly with a value, avoiding the closure overhead.
Breaking Changes
- AVR c_double change: On AVR targets,
c_doublenow maps tof32to match C’s 32-bit double. This may break FFI code that assumed 64-bit doubles. - Import syntax restriction: Using
struct S {}; use S::{self as Other};is no longer allowed because{self}imports require a module parent. - Multiple attribute precedence: For
export_name,link_name, andlink_section, the first attribute now takes precedence. - Minimum LLVM version: Rust 1.96.0 requires LLVM 21 or newer for building from source.
- -Csoft-float removed: This compiler flag is no longer supported.
- wasm target changes:
rustcno longer passes--allow-undefinedon wasm targets by default.
Known Issues
- No known issues reported in the official release notes.
Feature Flow
Official Release Notes
π οΈ Try These Free Tools
Paste your dependency file to check for end-of-life packages.
Plan your upgrade path with breaking change warnings and step-by-step guidance.
Paste your workflow YAML to audit action versions and pinning.
Track These Releases