Rust 1.89 and the long tail of const generics
Inferred array lengths in const generic position, plus x86 SIMD stabilizations that matter for anyone doing math.
Rust 1.89 is out. The headline is explicitly inferred const generic arguments — you can now write _ where a const generic parameter would go and let inference figure it out.
fn frobnicate<const N: usize>(arr: [u8; N]) -> [u8; N] { /* ... */ }
let data = [1, 2, 3, 4];
let out: [u8; _] = frobnicate(data); // N inferred as 4Previously you either wrote the number, which duplicated information the compiler already had, or restructured to avoid needing it. Small change, removes a real papercut, and it composes well with the growing amount of const-generic code in the ecosystem.
the SIMD stabilizations#
A large batch of x86 intrinsics stabilized, including AVX-512 families. This matters for a specific and growing population: people writing hand-tuned kernels in Rust for compression, encoding, cryptography, and increasingly ML inference.
Before this, using these intrinsics required nightly. Which meant that a production library wanting AVX-512 paths had to either require nightly — a non-starter for most consumers — or drop to C via FFI.
That was a genuine competitive disadvantage against C++ for numerical work and it is now mostly gone.
The pattern for using them safely:
if is_x86_feature_detected!("avx512f") {
unsafe { fast_path_avx512(data) }
} else if is_x86_feature_detected!("avx2") {
unsafe { fast_path_avx2(data) }
} else {
scalar_path(data)
}Runtime detection, multiple implementations, scalar fallback. Tedious and correct. std::simd remains unstable for the portable abstraction, which is the thing most people actually want and which continues to take a long time.
also in the release#
unsafeattributes get more coverage, continuing the 2024 edition direction.Result::flattenstabilizes. Small and frequently wanted.- Cargo now supports
--compile-time-depsfor building only what is needed for procedural macros and build scripts, which speeds up some tooling workflows meaningfully. - i686 targets raise their baseline CPU requirement, which will affect approximately nobody and will affect them a lot.
the const generics arc, for context#
Const generics were stabilized in a minimal form in Rust 1.51, four years ago. Since then the feature has been growing capability incrementally: first only integers, then inference improvements, then better error messages, now this.
The full feature — const generic expressions, where you can write [T; N * 2] — is still unstable and has been "coming soon" for a long time. The blocker is that arbitrary const expressions in type position require deciding when two type-level expressions are equal, which is undecidable in general and requires drawing a careful line.
Rust's approach to this has consistently been: ship the decidable subset, leave the hard part open, do not paint yourself into a corner. It is slow and it has not produced an unsound type system, which is more than several languages with similar features can say.
— Dom, August 8, 2025