Latest in branch 1.89
1.89.0
Released 07 Aug 2025
(10 months ago)
SoftwareRust
Version1.89
Initial release1.89.0
07 Aug 2025
(10 months ago)
Latest release1.89.0
07 Aug 2025
(10 months ago)
Support status18 Sep 2025
(Ended 8 months ago)
Release noteshttps://github.com/rust-lang/rust/releases/tag/1.89.0
Source codehttps://github.com/rust-lang/rust/tree/1.89.0
Downloadhttps://github.com/rust-lang/rust/releases/tag/1.89.0
Rust 1.89 ReleasesView full list

What Is New in Rust 1.89

Category Highlights
New Features Underscore inference for const generics, expanded x86 target features (sha512, sm3, sm4, kl, widekl, AVX512 intrinsics), stabilized SIMD intrinsics in const contexts, wasm32-unknown-unknown C ABI compliance.
Improvements New `mismatched_lifetime_syntaxes` lint, cross-compiled doctests support, `i128`/`u128` allowed in `extern "C"` without lint.
Breaking Changes `x86_64-apple-darwin` demoted to Tier 2 with host tools, which may affect CI pipelines and test coverage.

How does Rust 1.89 simplify const generic arguments?

Rust 1.89 lets you write an underscore (`_`) as a const generic argument and have the compiler infer the concrete value from surrounding context.

Example:

pub fn all_false<const LEN: usize>() -> [bool; LEN] {
    [false; _]
}

The underscore is resolved to the `LEN` constant, removing boilerplate when the size is already known. This is not allowed in signatures, keeping APIs explicit.

What new lifetime lint does Rust 1.89 introduce and why does it matter?

Rust 1.89 adds the `mismatched_lifetime_syntaxes` lint, which warns when a function's input and output lifetimes belong to different syntactic groups, making hidden lifetimes visible.

Typical warning:

warning: hiding a lifetime that's elided elsewhere is confusing
 --> src/lib.rs:1:18
  |
1 | fn items(scores: &[u8]) -> std::slice::Iter<u8> {
  |                  ^^^^^     -------------------- the same lifetime is hidden here
  |                  |
  |                  the lifetime is elided here
  |
  = help: use `'_` for type paths
  |
1 | fn items(scores: &[u8]) -> std::slice::Iter<'_, u8> {
  |                                             +++

In practice, this reduces confusion for newcomers and helps maintainers spot subtle lifetime bugs early.

Which new SIMD and cryptographic target features are available on x86 in Rust 1.89?

Rust 1.89 expands the `#[target_feature]` attribute to support `sha512`, `sm3`, `sm4`, `kl`, `widekl`, and a broader set of AVX512 features.

Example usage:

#[target_feature(enable = "avx512bw")]
pub fn fast_simd(data: &[u8]) -> Vec {
    // SIMD implementation here
}

Additionally, many AVX512, SHA512, SM3, and SM4 intrinsics are now stable and can be used in const contexts, enabling compile-time computation of cryptographic constants.

How does Rust 1.89 improve cross-compilation and FFI support?

Rust 1.89 adds three key improvements for cross-compilation and foreign-function interfaces.

  • Doctests are now executed when you run cargo test --doc --target <other_target>, with the ability to silence platform-specific failures via the `ignore-` annotation.
  • `i128` and `u128` no longer trigger the `improper_ctypes_definitions` lint, allowing them in `extern "C"` functions where the platform provides a compatible `__int128` type.
  • The `wasm32-unknown-unknown` target now follows the standards-compliant C ABI for `extern "C"` functions, improving interoperability with other languages and toolchains.

These changes reduce friction when targeting embedded or WebAssembly environments and when interfacing with C libraries that require 128-bit integers.

What is the impact of demoting x86_64-apple-darwin to Tier 2 with host tools?

The `x86_64-apple-darwin` target is being moved from Tier 1 to Tier 2, meaning the compiler and standard library will still be built but are no longer guaranteed to pass the full automated test suite.

In practice, most existing macOS builds will continue to work, but CI pipelines that rely on the Tier 1 guarantee may start seeing regressions or missing test coverage. Teams should monitor build logs and be prepared to file bugs if compatibility issues arise.

Frequently Asked Questions

Does Rust 1.89 allow using underscore in const generic arguments?
Yes, you can write an underscore and the compiler will infer the concrete const value from the surrounding context.

How can I silence the new mismatched lifetime syntax warning?
Use the explicit lifetime placeholder `'_` in the return type, for example std::slice::Iter<'_, u8>.

Which x86 SIMD intrinsics are now stable in const contexts?
AVX512, SHA512, SM3 and SM4 intrinsics are stable and can be used inside const functions.

Can I write extern "C" functions that take i128 on all platforms?
They are allowed when the platform provides a compatible __int128 type, but on platforms without __int128 the layout may not match any C type.

How do I run doctests for a non-native target in Rust 1.89?
Run cargo test --doc --target <target-triple>, and annotate failing examples with ignore-<target-triple> to skip them.

What should I know about the x86_64-apple-darwin Tier 2 change?
The target will still build, but it is no longer guaranteed to pass the full test suite, so CI pipelines may start seeing regressions.

Releases In Branch 1.89

VersionRelease date
1.89.007 Aug 2025
(10 months ago)