Rust 1.95.0
Released on April 16, 2026
What's Changed
- 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
thread::scope: document how join interacts with TLS destructors- Speed up
str::containson aarch64 targets withneontarget feature enabled by default MaybeUninit<[T; N]>: From<[MaybeUninit; N]> MaybeUninit<[T; N]>: AsRef<[MaybeUninit; N]> MaybeUninit<[T; N]>: AsRef<[MaybeUninit]> MaybeUninit<[T; N]>: AsMut<[MaybeUninit; N]> MaybeUninit<[T; N]>: AsMut<[MaybeUninit]> [MaybeUninit; N]: From > Cell<[T; N]>: AsRef<[Cell; N]> Cell<[T; N]>: AsRef<[Cell]> Cell<[T]>: AsRef<[Cell]> 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_uncheckedfmt::from_fnControlFlow::is_breakControlFlow::is_continue
- 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
- 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 - In search results, rank unstable items lower
- Add new "hide deprecated items" setting in rustdoc
- Update to LLVM 22
Full Changelog
Language
--------
- Stabilize if let guards on match arms
- irrefutable_let_patterns lint 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
Compiler
--------
Platform Support
----------------
- Promote powerpc64-unknown-linux-musl to Tier 2 with host tools
- Promote aarch64-apple-tvos to Tier 2
- Promote aarch64-apple-tvos-sim to Tier 2
- Promote aarch64-apple-watchos to Tier 2
- Promote aarch64-apple-watchos-sim to Tier 2
- Promote aarch64-apple-visionos to Tier 2
- Promote aarch64-apple-visionos-sim to Tier 2
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html
Libraries
---------
- thread::scope: document how join interacts with TLS destructors
- Speed up str::contains on aarch64 targets with neon target feature enabled by default
Stabilized APIs
---------------
- MaybeUninit<[T; N]>: From<[MaybeUninit
- MaybeUninit<[T; N]>: AsRef<[MaybeUninit
- MaybeUninit<[T; N]>: AsRef<[MaybeUninit
- MaybeUninit<[T; N]>: AsMut<[MaybeUninit
- MaybeUninit<[T; N]>: AsMut<[MaybeUninit
- Cell<[T; N]>: AsRef<[Cell
- core::range::RangeInclusiveIter
- <*const T>::as_ref_unchecked
These previously stable APIs are now stable in const contexts:
Cargo
-----
- docs(report): enhance man pages for cargo report *
Rustdoc
-----
- In search results, rank unstable items lower
- Add new "hide deprecated items" setting in rustdoc
Compatibility Notes
-------------------
- Array coercions may now result in less inference constraints than before
- Importing $crate without renaming, i.e. use $crate::{self};, is now no longer permitted due to stricter error checking for self imports.
- 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 const or static.
- Check lifetime bounds of types mentioning only type parameters
- Report more visibility-related ambiguous import errors
- Deprecate Eq::assert_receiver_is_total_eq and 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 ref and mut ref mut patterns, 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.
- JSON target specs have been destabilized and now require -Z unstable-options to use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for the build-std project adding that support, JSON target specs are being proactively gated to ensure they remain unstable even if build-std is stabilized. Cargo now includes the -Z json-target-spec CLI flag to automatically pass -Z unstable-options to the compiler when needed. See #150151, #151534, and rust-lang/cargo#16557.
- The arguments of #[feature] attributes on invalid targets are now checked
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.