Rust 1.94.0 Is Here: What's New in the Latest Release
Rust 1.94.0 is now available. To upgrade from a previous installation via rustup, run:
$ rustup update stable
New to Rust? You can install rustup from the official website. The full release notes for 1.94.0 are also available for a complete breakdown of changes.
Want to help shape future releases? Switch to the beta channel (rustup default beta) or nightly channel (rustup default nightly) and file any bugs you encounter.
What's in 1.94.0 stable
Array windows
Rust 1.94 stabilizes array_windows, a new slice iterator that behaves like the existing windows method — but with a compile-time constant length. That means iterator items are typed as &[T; N] rather than the dynamically-sized &[T], enabling destructuring patterns and eliminating the need for manual indexing. In many cases, the compiler can even infer the window size from how the iterator is used.
Consider a classic example from the 2016 Advent of Code: detecting ABBA patterns — "two different characters followed by the reverse of that pair, such as xyyx or abba." Assuming ASCII input, this can now be written cleanly as:
The destructuring pattern in the closure tells the compiler to use windows of size 4 — no explicit argument needed. Compare this to the older .windows(4) approach, which returns a dynamically-sized slice requiring manual indexing and relying on the optimizer to eliminate runtime bounds checks.
Cargo config inclusion
Cargo now supports an include key in configuration files (.cargo/config.toml), making it easier to split, share, and manage Cargo settings across projects and environments. Included paths can be marked optional to gracefully handle cases where a file may not be present — for instance, configurations tied to individual developer preferences.
# array of paths
= [
"frodo.toml",
"samwise.toml",
]
# inline tables for more control
= [
{ = "required.toml" },
{ = "optional.toml", = true },
]
See the include documentation for the full set of options.
TOML 1.1 support in Cargo
Cargo now parses TOML v1.1 for both manifests and configuration files. See the TOML release notes for a full list of changes, including:
- Inline tables spanning multiple lines and with trailing commas
\xHHand\estring escape characters- Optional seconds in time values (defaults to 0)
For example, a dependency declaration like this:
= { = "1.0", = ["derive"] }
...can now be expressed in a more readable, multi-line form:
serde = {
version = "1.0",
features = ["derive"],
}
One important caveat: adopting these TOML 1.1 features in Cargo.toml will raise your development MSRV (minimum supported Rust version) to require the new Cargo parser, and third-party tools that read manifest files may also need to update their own parsers. That said, Cargo automatically rewrites manifests at publish time to remain compatible with older parsers, so you can still target an earlier MSRV for your crate's end users.
Stabilized APIs
<[T]>::array_windows<[T]>::element_offsetLazyCell::getLazyCell::get_mutLazyCell::force_mutLazyLock::getLazyLock::get_mutLazyLock::force_mutimpl TryFrom<char> for usizestd::iter::Peekable::next_if_mapstd::iter::Peekable::next_if_map_mut- x86
avx512fp16intrinsics (excluding those with a direct dependency on the unstablef16type) - AArch64 NEON fp16 intrinsics (excluding those with a direct dependency on the unstable
f16type) f32::consts::EULER_GAMMAf64::consts::EULER_GAMMAf32::consts::GOLDEN_RATIOf64::consts::GOLDEN_RATIO
The following previously stable APIs are now also usable in const contexts:
Other Changes
For a complete picture of what changed in this release, see the full changelogs for Rust, Cargo, and Clippy.
Contributors to 1.94.0
Rust 1.94.0 was made possible by the collective effort of many contributors across the community. Thank you to everyone involved.