Rust 1.94.0
Released on March 5, 2026
What's Changed
- Impls and impl items inherit
dead_codelint level of the corresponding traits and trait items - Stabilize additional 29 RISC-V target features including large portions of the RVA22U64 / RVA23U64 profiles
- Add warn-by-default
unused_visibilitieslint for visibility onconst _declarations - Update to Unicode 17
- Avoid incorrect lifetime errors for closures
- Relax
T: Ordbound for someBinaryHeapmethods. <[T]>::array_windows<[T]>::element_offsetLazyCell::getLazyCell::get_mutLazyCell::force_mutLazyLock::getLazyLock::get_mutLazyLock::force_mutimpl TryFromfor usize std::iter::Peekable::next_if_mapstd::iter::Peekable::next_if_map_mut- x86
avx512fp16intrinsics - AArch64 NEON fp16 intrinsics
f32::consts::EULER_GAMMAf64::consts::EULER_GAMMAf32::consts::GOLDEN_RATIOf64::consts::GOLDEN_RATIOf32::mul_addf64::mul_add
- Stabilize the config include key. The top-level include config key allows loading additional config files, enabling better organization, sharing, and management of Cargo configurations across projects and environments. docs #16284
- Stabilize the pubtime field in registry index. This records when a crate version was published and enables time-based dependency resolution in the future. Note that crates.io will gradually backfill existing packages when a new version is published. Not all crates have pubtime yet. #16369 #16372
- Cargo now parses TOML v1.1 for manifests and configuration files. Note that using these features in Cargo.toml will raise your development MSRV, but the published manifest remains compatible with older parsers. #16415
- Make
CARGO_BIN_EXE_available at runtime
- Forbid freely casting lifetime bounds of
dyn-types - Make closure capturing have consistent and correct behaviour around patterns
- Standard library macros are now imported via prelude, not via injected
#[macro_use] - Don't strip shebang in expression-context
include!(…)s - Ambiguous glob reexports are now also visible cross-crate
- Don't normalize where-clauses before checking well-formedness
- Introduce a future compatibility warning on codegen attributes on body-free trait methods
- On Windows
std::time::SystemTime::checked_sub_durationwill returnNonefor times before the Windows epoch (1/1/1601) - Lifetime identifiers such as
'aare now NFC normalized. - Overhaul filename handling for cross-compiler consistency
Full Changelog
Language
--------
- Impls and impl items inherit dead_code lint level of the corresponding traits and trait items
- Add warn-by-default unused_visibilities lint for visibility on const _ declarations
- Avoid incorrect lifetime errors for closures
Platform Support
----------------
- Add riscv64im-unknown-none-elf as a tier 3 target
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
---------
- Relax T: Ord bound for some BinaryHeap methods.
Stabilized APIs
---------------
- std::iter::Peekable::next_if_map
- std::iter::Peekable::next_if_map_mut
(excluding those that depend directly on the unstable f16 type)
- AArch64 NEON fp16 intrinsics
(excluding those that depend directly on the unstable f16 type)
These previously stable APIs are now stable in const contexts:
Cargo
-----
- Stabilize the config include key. The top-level include config key allows loading additional config files, enabling better organization, sharing, and management of Cargo configurations across projects and environments. docs #16284
- Stabilize the pubtime field in registry index. This records when a crate version was published and enables time-based dependency resolution in the future. Note that crates.io will gradually backfill existing packages when a new version is published. Not all crates have pubtime yet. #16369 #16372
- Cargo now parses TOML v1.1 for manifests and configuration files. Note that using these features in Cargo.toml will raise your development MSRV, but the published manifest remains compatible with older parsers. #16415
- Make CARGO_BIN_EXE_ available at runtime
Compatibility Notes
-------------------
- Forbid freely casting lifetime bounds of dyn-types
- Make closure capturing have consistent and correct behaviour around patterns
Some finer details of how precise closure captures get affected by pattern matching have been changed. In some cases, this can cause a non-move closure that was previously capturing an entire variable by move, to now capture only part of that variable by move, and other parts by borrow. This can cause the borrow checker to complain where it previously didn't, or cause Drop to run at a different point in time.
- Standard library macros are now imported via prelude, not via injected #[macro_use]
This will raise an error if macros of the same name are glob imported.
For example if a crate defines their own matches macro and then glob imports that,
it's now ambiguous whether the custom or standard library matches is meant and
an explicit import of the name is required to resolve the ambiguity.
One exception is core::panic and std::panic, if their import is ambiguous
a new warning (ambiguous_panic_imports) is raised.
This may raise a new warning (ambiguous_panic_imports) on #![no_std] code glob importing the std crate.
Both core::panic! and std::panic! are then in scope and which is used is ambiguous.
- Don't strip shebang in expression-context include!(…)s
This can cause previously working includes to no longer compile if they included files which started with a shebang.
- Ambiguous glob reexports are now also visible cross-crate
This unifies behavior between local and cross-crate errors on these exports, which may introduce new ambiguity errors.
- Don't normalize where-clauses before checking well-formedness
- Introduce a future compatibility warning on codegen attributes on body-free trait methods
These attributes currently have no effect in this position.
- Lifetime identifiers such as 'a are now NFC normalized.
- Overhaul filename handling for cross-compiler consistency
Any paths emitted by compiler now always respect the relative-ness of the paths and --remap-path-prefix given originally.
One side-effect of this change is that paths emitted for local crates in Cargo (path dependencies and workspace members) are no longer absolute but relative when emitted as part of a diagnostic in a downstream crate.
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.
- Switch to annotate-snippets for error emission
This should preserve mostly the same outputs in rustc error messages.