Rust versions / 1.95
Rust release · Apr 16, 2026
Rust 1.95: what's new, what was stabilized
Short answerRust 1.95 was released on Apr 16, 2026: 2 language stabilizations (Stabilize if let guards on match arms); 40 newly stable APIs (MaybeUninit<[T; N]>: From<[MaybeUninit<T>; N]>, MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>; N]>, MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>]>, MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>; N]>, ...); 13 compatibility notes that can affect existing code.
← Rust 1.94All versionsRust 1.96 →
Language features stabilized
- Stabilize if let guards on match arms
- Stabilize inline assembly for PowerPC and PowerPC64
40 APIs stabilized
MaybeUninit<[T; N]>: From<[MaybeUninit<T>; N]>, MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>; N]>, MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>]>, MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>; N]>, MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>]>, [MaybeUninit<T>; N]: From<MaybeUninit<[T; N]>>, Cell<[T; N]>: AsRef<[Cell<T>; N]>, Cell<[T; N]>: AsRef<[Cell<T>]>, Cell<[T]>: AsRef<[Cell<T>]>, bool: TryFrom<{integer}>, AtomicPtr::update, AtomicPtr::try_update, AtomicBool::update, AtomicBool::try_update, AtomicIn::update, AtomicIn::try_update, AtomicUn::update, AtomicUn::try_update, cfg_select!, mod core::range, core::range::RangeInclusive, core::range::RangeInclusiveIter, core::hint::cold_path, <*const T>::as_ref_unchecked, <*mut T>::as_ref_unchecked, <*mut T>::as_mut_unchecked, Vec::push_mut, Vec::insert_mut, VecDeque::push_front_mut, VecDeque::push_back_mut, VecDeque::insert_mut, LinkedList::push_front_mut, LinkedList::push_back_mut, Layout::dangling_ptr, Layout::repeat, Layout::repeat_packed, Layout::extend_packed, fmt::from_fn, ControlFlow::is_break, ControlFlow::is_continue
Can it break my build?
The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:
- Array coercions may now result in less inference constraints than before
- Importing
$cratewithout renaming, i.e.use $crate::{self};, is now no longer permitted due to stricter error checking forselfimports. - const-eval: be more consistent in the behavior of padding during typed copies.
- A future-incompatibility warning lint
ambiguous_glob_imported_traitsis now reported when using an ambiguously glob imported trait - Check lifetime bounds of types mentioning only type parameters
- Report more visibility-related ambiguous import errors
- Deprecate
Eq::assert_receiver_is_total_eqand emit future compatibility warnings on manual impls - powerpc64: Use the ELF ABI version set in target spec instead of guessing (fixes the ELF ABI used by the OpenBSD target)
- Matching on a
#[non_exhaustive]enum now reads the discriminant, even if the enum has only one variant. This can cause closures to capture values that they previously wouldn't. mut refandmut ref mutpatterns, part of the unstable Match Ergonomics 2024 RFC, were accidentally allowed on stable within struct pattern field shorthand. These patterns are now correctly feature-gated as unstable in this position.- Add future-compatibility warning for derive helper attributes which conflict with built-in attributes
- JSON target specs have been destabilized and now require
-Z unstable-optionsto use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for thebuild-stdproject adding that support, JSON target specs are being proactively gated to ensure they remain unstable even ifbuild-stdis stabilized. Cargo now includes the-Z json-target-specCLI flag to automatically pass-Z unstable-optionsto the compiler when needed. See #150151, #151534, and rust-lang/cargo#16557. - [The arguments of
#[feature]attributes on invalid targets are now checked](https://github.com/rust-lang/rust/issues/153764)
Use it
rustup update stable # get the newest release
rustup install 1.95 # or exactly this one
rustup override set 1.95 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.95" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.
Full release notes
Language
- Stabilize
if letguards on match arms irrefutable_let_patternslint no longer lints on let chains- Support importing path-segment keywords with renaming
- Stabilize inline assembly for PowerPC and PowerPC64
- const-eval: be more consistent in the behavior of padding during typed copies
- Const blocks are no longer evaluated to determine if expressions involving fallible operations can implicitly be constant-promoted.. Expressions whose ability to implicitly be promoted would depend on the result of a const block are no longer implicitly promoted.
- Make operational semantics of pattern matching independent of crate and module
<a id="1.95-Compiler"></a>
Compiler
- Stabilize
--remap-path-scopefor controlling the scoping of how paths get remapped in the resulting binary - Apply patches for CVE-2026-6042 and CVE-2026-40200 to vendored musl
<a id="1.95-Platform-Support"></a>
Platform Support
- Promote
powerpc64-unknown-linux-muslto Tier 2 with host tools - Promote
aarch64-apple-tvosto Tier 2 - Promote
aarch64-apple-tvos-simto Tier 2 - Promote
aarch64-apple-watchosto Tier 2 - Promote
aarch64-apple-watchos-simto Tier 2 - Promote
aarch64-apple-visionosto Tier 2 - Promote
aarch64-apple-visionos-simto Tier 2
Refer to Rust's platform support page for more information on Rust's tiered platform support.
<a id="1.95-Libraries"></a>
Libraries
thread::scope: document how join interacts with TLS destructors- Speed up
str::containson aarch64 targets withneontarget feature enabled by default
<a id="1.95-Stabilized-APIs"></a>
Stabilized APIs
- [
MaybeUninit<[T; N]>: From<[MaybeUninit<T>; N]>](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-From%3CMaybeUninit%3C%5BT;+N%5D%3E%3E-for-%5BMaybeUninit%3CT%3E;+N%5D) - [
MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>; N]>](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-AsRef%3C%5BMaybeUninit%3CT%3E;+N%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [
MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>]>](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-AsRef%3C%5BMaybeUninit%3CT%3E%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [
MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>; N]>](https://doc.rust-lang.org/beta/std/mem/union.MaybeUninit.html#impl-AsMut%3C%5BMaybeUninit%3CT%3E;+N%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [
MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>]>](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-AsMut%3C%5BMaybeUninit%3CT%3E%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [
[MaybeUninit<T>; N]: From<MaybeUninit<[T; N]>>](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-From%3C%5BMaybeUninit%3CT%3E;+N%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [
Cell<[T; N]>: AsRef<[Cell<T>; N]>](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#impl-AsRef%3C%5BCell%3CT%3E;+N%5D%3E-for-Cell%3C%5BT;+N%5D%3E) - [
Cell<[T; N]>: AsRef<[Cell<T>]>](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#impl-AsRef%3C%5BCell%3CT%3E%5D%3E-for-Cell%3C%5BT;+N%5D%3E) - [
Cell<[T]>: AsRef<[Cell<T>]>](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#impl-AsRef%3C%5BCell%3CT%3E%5D%3E-for-Cell%3C%5BT%5D%3E) bool: TryFrom<{integer}>AtomicPtr::updateAtomicPtr::try_updateAtomicBool::updateAtomicBool::try_updateAtomicIn::updateAtomicIn::try_updateAtomicUn::updateAtomicUn::try_updatecfg_select!mod core::rangecore::range::RangeInclusivecore::range::RangeInclusiveItercore::hint::cold_path<*const T>::as_ref_unchecked<*mut T>::as_ref_unchecked<*mut T>::as_mut_uncheckedVec::push_mutVec::insert_mutVecDeque::push_front_mutVecDeque::push_back_mutVecDeque::insert_mutLinkedList::push_front_mutLinkedList::push_back_mutLayout::dangling_ptrLayout::repeatLayout::repeat_packedLayout::extend_packed
These previously stable APIs are now stable in const contexts:
<a id="1.95-Rustdoc"></a>
Rustdoc
<a id="1.95-Compatibility-Notes"></a>
Compatibility Notes
- Array coercions may now result in less inference constraints than before
- Importing
$cratewithout renaming, i.e.use $crate::{self};, is now no longer permitted due to stricter error checking forselfimports. - const-eval: be more consistent in the behavior of padding during typed copies. In very rare cases, this may cause compilation errors due to bytes from parts of a pointer ending up in the padding bytes of a
constorstatic. - A future-incompatibility warning lint
ambiguous_glob_imported_traitsis now reported when using an ambiguously glob imported trait - Check lifetime bounds of types mentioning only type parameters
- Report more visibility-related ambiguous import errors
- Deprecate
Eq::assert_receiver_is_total_eqand emit future compatibility warnings on manual impls - powerpc64: Use the ELF ABI version set in target spec instead of guessing (fixes the ELF ABI used by the OpenBSD target)
- Matching on a
#[non_exhaustive]enum now reads the discriminant, even if the enum has only one variant. This can cause closures to capture values that they previously wouldn't. mut refandmut ref mutpatterns, part of the unstable Match Ergonomics 2024 RFC, were accidentally allowed on stable within struct pattern field shorthand. These patterns are now correctly feature-gated as unstable in this position.- Add future-compatibility warning for derive helper attributes which conflict with built-in attributes
- JSON target specs have been destabilized and now require
-Z unstable-optionsto use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for thebuild-stdproject adding that support, JSON target specs are being proactively gated to ensure they remain unstable even ifbuild-stdis stabilized. Cargo now includes the-Z json-target-specCLI flag to automatically pass-Z unstable-optionsto the compiler when needed. See #150151, #151534, and rust-lang/cargo#16557. - [The arguments of
#[feature]attributes on invalid targets are now checked](https://github.com/rust-lang/rust/issues/153764)
<a id="1.95-Internal-Changes"></a>
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.96Released May 28, 2026.Read it next →Also worth your time
Did this answer your question?