1.96.0
Breaking Changes📦 rust-languageView on GitHub →
⚠ 10 breaking✨ 16 features🐛 3 fixes⚡ 1 deprecations🔧 14 symbols
Summary
This release introduces stabilized range APIs, new `From` implementations for synchronization primitives, and several compiler and Cargo improvements. It also enforces stricter type checking and modifies behavior for certain attributes and imports.
⚠️ Breaking Changes
- The layout of `#[repr(Int)]` enums in edge cases involving fields of uninhabited zero-sized types has been fixed, which may change memory layout.
- Unsize-coercing into `Pin<Foo>` where `Foo` doesn't implement `Deref` is now prevented, as it previously produced a type with no useful public API.
- The accidentally stabilized `#![reexport_test_harness_main]` attribute is now gated.
- Errors are reported for return-position-impl-trait-in-traits whose types are too private.
- The `uninhabited_static` lint is now reported in dependencies and is deny-by-default.
- The `-Csoft-float` flag has been removed.
- Importing structs with `::{self [as name]}` (e.g., `struct S {}; use S::{self as Other};`) is no longer permitted because `{self}` imports require a module parent.
- For `export_name`, `link_name`, and `link_section` attributes, if multiple instances are present, the first one now takes precedence (previously behavior might have been different or undefined).
- The minimum external LLVM version required has been updated to 21.
- On `avr` targets, `c_double` is now changed to `f32` to match C's 32-bit `double` type on that target. This is a breaking change for code relying on `c_double` being 64-bit on `avr`.
Migration Steps
- If you relied on multi-line deprecation notes rendering across multiple lines in rustdoc, use two spaces followed by a newline (` \n`) within the deprecation note string to force a linebreak.
✨ New Features
- The `expr` metavariable can now be passed to `cfg`.
- Never types in tuple expressions are always coerced.
- Support for s390x vector registers in inline assembly has been added.
- Constants of type `ManuallyDrop` can now be used as patterns (fixing a regression from 1.94.0).
- Link relaxation feature is enabled for LoongArch Linux targets.
- The baseline for `riscv64gc-unknown-fuchsia` has been updated to RVA22 + vector.
- Support for iterating over ranges of `NonZero` integers has been added.
- Stabilized API: `assert_matches!` macro.
- Stabilized API: `debug_assert_matches!` macro.
- Stabilized API: `From<T> for AssertUnwindSafe<T>`.
- Stabilized API: `From<T> for LazyCell<T, F>`.
- Stabilized API: `From<T> for LazyLock<T, F>`.
- Stabilized API: `core::range::RangeToInclusive` and `core::range::RangeToInclusiveIter`.
- Stabilized API: `core::range::RangeFrom` and `core::range::RangeFromIter`.
- Stabilized API: `core::range::Range` and `core::range::RangeIter`.
- Cargo now allows a dependency to specify both a git repository and an alternate registry.
🐛 Bug Fixes
- Incorrect inference guidance of function arguments in rare cases is avoided.
- Fix SGX delayed host lookup via ToSocketAddr.
- Fixed CVE-2026-5222 and CVE-2026-5223 in Cargo.
Affected Symbols
⚡ Deprecations
- Deprecation notes in rustdoc are now rendered like any other documentation, which may cause multi-line deprecation notes to render as single lines unless an explicit markdown linebreak (` \n`) is used.