← Back to all releases

Rust 1.94.0

Released on March 5, 2026

What's Changed

  • 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
Full Changelog

Language

--------

- Impls and impl items inherit dead_code lint 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_visibilities lint for visibility on const _ declarations

- Update to Unicode 17

- 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

---------------

- <[T]>::array_windows

- <[T]>::element_offset

- LazyCell::get

- LazyCell::get_mut

- LazyCell::force_mut

- LazyLock::get

- LazyLock::get_mut

- LazyLock::force_mut

- impl TryFrom for usize

- std::iter::Peekable::next_if_map

- std::iter::Peekable::next_if_map_mut

- x86 avx512fp16 intrinsics

(excluding those that depend directly on the unstable f16 type)

- AArch64 NEON fp16 intrinsics

(excluding those that depend directly on the unstable f16 type)

- f32::consts::EULER_GAMMA

- f64::consts::EULER_GAMMA

- f32::consts::GOLDEN_RATIO

- f64::consts::GOLDEN_RATIO

These previously stable APIs are now stable in const contexts:

- f32::mul_add

- f64::mul_add

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.

- On Windows std::time::SystemTime::checked_sub_duration will return None for times before the Windows epoch (1/1/1601)

- 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.