Radar · Rust · Archive · Week 11 · Mar 9 – 15, 2026
Announcing Rust 1.94.0
Worth knowingcompiler
- What changed
- The Rust team released stable 1.94.0, adding new compiler features and bug fixes.
- Production impact
- The source does not say.
- Try it
- Run
rustc --versionto confirm you are on 1.94.0. - Source
- blog.rust-lang.org/2026/03/05/Rust-1.94.0/
Understand it, then run it
Rust 1.94.0 adds a new method called array_windows for slices. Instead of getting a slice of four elements each time, you get an array of four elements, which lets the compiler know the size at compile time. This makes it easier to write code that looks at fixed-size windows of a slice, like finding patterns in a string. The change also lets Cargo read a new include key in its configuration files, so you can share common Cargo settings across projects. Finally, Cargo now understands the newer TOML 1.1 format, which adds a few more ways to write configuration files.
Run it now
// This program demonstrates the new `array_windows` method introduced in Rust 1.94.0.
// It checks whether a string contains an ABBA pattern (e.g., "xyyx" or "abba").
// The output will be `Has ABBA? true` for the test string "xyyx" and
// `Has ABBA? false` for a string without such a pattern.
fn has_abba(s: &str) -> bool {
// Convert the string to a byte slice and iterate over windows of four bytes.
// Each window is a reference to an array `[u8; 4]`, allowing pattern matching.
s.as_bytes()
.array_windows()
.any(|[a1, b1, b2, a2]| (a1 != b1) && (a1 == a2) && (b1 == b2))
}
fn main() {
let test_with_abba = "xyyx";
let test_without_abba = "abcd";
println!("Has ABBA? {}", has_abba(test_with_abba));
println!("Has ABBA? {}", has_abba(test_without_abba));
}
What it printed when we ran it on Rust 1.98.1 (edition 2024)
Has ABBA? true Has ABBA? false
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed