Rust 1.94.0 Released: What's New in the Latest Version
·
5 min read
# Rust 1.94.0 Released: Array Windows, Cargo Config Inclusion, and TOML 1.1 Support
The Rust team has released version 1.94.0 of the programming language, continuing its mission to help developers build reliable, efficient, and safe software. This release brings several quality-of-life improvements to both the language's standard library and its build tooling, with particular emphasis on ergonomic slice iteration, more flexible Cargo configuration management, and updated TOML parsing capabilities.
Existing Rust users can upgrade via `rustup`:
```console
$ rustup update stable
```
New users can [install `rustup`](https://www.rust-lang.org/install.html) from the official website. Full release notes are available in the [1.94.0 documentation](https://doc.rust-lang.org/stable/releases.html#version-1940-2026-03-05).
Developers interested in testing pre-release versions can switch to the beta channel (`rustup default beta`) or nightly channel (`rustup default nightly`). Bug reports can be submitted through the [project's GitHub repository](https://github.com/rust-lang/rust/issues/new/choose).
---
## What's in 1.94.0 Stable
### Array Windows
One of the most developer-friendly additions in this release is the stabilization of the [`array_windows`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.array_windows) method, which provides a more ergonomic and type-safe way to iterate over slices using fixed-length windows.
Until now, Rust developers who needed sliding window access over a slice would reach for the existing [`windows`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.windows) method. While functional, `windows` returns dynamically-sized `&[T]` slices, meaning the compiler cannot enforce the expected window length at compile time. This often requires manual indexing and places trust in the optimizer to eliminate bounds checks that would theoretically be redundant.
The new `array_windows` method addresses this by returning constant-length `&[T; N]` arrays instead. This shift from runtime-sized slices to compile-time-sized arrays has meaningful practical benefits: it enables pattern matching through destructuring directly in closure signatures, improves code readability, and gives the compiler additional information to work with during optimization.
Critically, the compiler can usually infer the window length automatically from the surrounding context—there is no need to specify the size explicitly as a generic parameter in most cases.
To illustrate the improvement, consider this example drawn from a [2016 Advent of Code puzzle](https://adventofcode.com/2016/day/7) that searches for ABBA patterns—sequences where two distinct characters are immediately followed by their reverse, such as `xyyx` or `abba`. When working with ASCII strings, the solution can be written as:
```rust
fn has_abba(s: &str) -> bool {
s.as_bytes()
.array_windows()
.any(|[a1, b1, b2, a2]| (a1 != b1) && (a1 == a2) && (b1 == b2))
}
```
Notice how the destructuring pattern `[a1, b1, b2, a2]` in the closure allows the compiler to infer a window size of 4 without any explicit annotation. This is both more concise and more expressive than the equivalent using the older `.windows(4)` approach, where you would need to manually index into the slice with something like `w[0]`, `w[1]`, and so forth—losing the clarity of named bindings and relying on the optimizer to prove bounds-check elimination.
For developers working in domains like signal processing, text parsing, or algorithm implementation where sliding windows are common, this API addition is a meaningful ergonomic improvement that aligns well with Rust's broader philosophy of zero-cost abstractions.
---
### Cargo Config Inclusion
Cargo configuration files (`.cargo/config.toml`) now support an `include` key, enabling more modular and environment-aware organization of build settings. This is a practical addition for teams managing multiple projects or developers who need to maintain machine-specific or role-specific configurations without embedding those details directly in shared files.
With this feature, a base configuration file can delegate to additional files, which are resolved relative to the including file's location:
```toml
# array of paths
include = [
"frodo.toml",
"samwise.toml",
]
# inline tables for more control
include = [
{ path = "required.toml" },
{ path = "optional.toml", optional = true },
]
```
The `optional` flag is especially useful in scenarios where a configuration file may not exist in all environments. For example, a team might maintain a shared baseline configuration while allowing individual developers to layer in personal settings—registry authentication overrides, custom tool paths, or local mirror configurations—through an optional file that exists only on their machines. If the file is absent and the path is marked `optional`, Cargo silently skips it rather than raising an error.
This feature addresses a common pain point for teams using monorepos or complex CI/CD pipelines where environment-specific Cargo settings previously required awkward workarounds. Complete details are available in the [`include` documentation](https://doc.rust-lang.org/nightly/cargo/reference/config.html#including-extra-configuration-files).
---
### TOML 1.1 Support in Cargo
Cargo now parses both manifests and configuration files using [TOML v1.1](https://toml.io/en/v1.1.0). The [TOML release notes](https://github.com/toml-lang/toml/releases/tag/1.1.0) document the full scope of changes, but the highlights relevant to Rust development include:
- **Inline tables can now span multiple lines and include trailing commas**, significantly improving readability for complex dependency declarations
- **New string escape sequences** `\xHH` and `\e` for hexadecimal character escaping and the escape character, respectively
- **Time values can omit seconds**, which default to 0 when not specified
To appreciate the readability gain from multi-line inline tables, consider how a compact dependency declaration in an older TOML format:
```toml
serde = { version = "1.0", features = ["derive"] }
```
Can now be expressed more clearly as:
```toml
serde = {
version = "1.0",
features = ["derive"],
}
```
For crates with many feature flags or optional dependencies, this improvement alone can make `Cargo.toml` files substantially easier to read and maintain, particularly in code review contexts.
There is one important compatibility consideration to keep in mind: adopting TOML 1.1 syntax features in your `Cargo.toml`—such as multi-line inline tables—raises the minimum supported Rust version of your development environment to 1.94.0 or later. Third-party tools that parse `Cargo.toml` files independently of Cargo may also require updates to support the new format. That said, Cargo automatically converts manifests to a backward-compatible format when publishing crates to crates.io, meaning end users of your crate are not affected by your use of newer TOML syntax in the source repository.
---
### Stabilized APIs
Rust 1.94.0 stabilizes a broad set of APIs across the standard library, expanding what developers can rely on in production code without opting into nightly features:
- [`<[T]>::array_windows`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.array_windows)
- [`<[T]>::element_offset`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.element_offset)
- [`LazyCell::get`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get), [`LazyCell::get_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get_mut), and [`LazyCell::force_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.force_mut)
- [`LazyLock::get`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get), [`LazyLock::get_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get_mut), and [`LazyLock::force_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.force_mut)
- [`impl TryFrom for usize`](https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3Cchar%3E-for-usize)
- [`std::iter::Peekable::next_if_map`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map) and [`next_if_map_mut`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map_mut)
- [x86 `avx512fp16` intrinsics](https://github.com/rust-lang/rust/issues/127213) (excluding those dependent on the unstable `f16` type)
- [AArch64 NEON fp16 intrinsics](https://github.com/rust-lang/rust/issues/136306) (excluding those dependent on the unstable `f16` type)
- Mathematical constants: [`f32::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f32/consts/constant.EULER_GAMMA.html), [`f64::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f64/consts/constant.EULER_GAMMA.html), [`f32::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f32/consts/constant.GOLDEN_RATIO.html), and [`f64::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f64/consts/constant.GOLDEN_RATIO.html)
The stabilization of SIMD intrinsics for both x86 AVX-512 FP16 and AArch64 NEON FP16 is particularly notable for developers building high-performance numerical computation libraries, as it enables half-precision floating-point operations through stable Rust on supported hardware.
Additionally, the following previously stable APIs now support use in `const` contexts:
- [`f32::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.mul_add)
- [`f64::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.mul_add)
The `mul_add` function computes a fused multiply-add operation (`(a * b) + c`) in a single step, which is both more precise and potentially more efficient than chaining separate multiplication and addition. Its availability in `const` contexts opens up new possibilities for compile-time floating-point computations.
---
### Other Changes
For complete details on everything new in this release, see the changelogs for [Rust](https://github.com/rust-lang/rust/releases/tag/1.94.0), [Cargo](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-194-2026-03-05), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-194).
---
## Contributors to 1.94.0
Rust 1.94.0 represents the collective effort of numerous contributors from around the world—volunteers, corporate contributors, and open source maintainers who collectively ensure that Rust continues to evolve in a thoughtful, community-driven manner. [Thanks to everyone who contributed!](https://thanks.rust-lang.org/rust/1.94.0/)