Rust versions / 1.89
Rust release · Aug 7, 2025
Rust 1.89: what's new, what was stabilized
Short answerRust 1.89 was released on Aug 7, 2025: 6 language stabilizations (Stabilize explicitly inferred const arguments (feature(generic_arg_infer))); 19 newly stable APIs (NonZero<char>, File::lock, File::lock_shared, File::try_lock, ...); 15 compatibility notes that can affect existing code.
← Rust 1.88All versionsRust 1.90 →
Language features stabilized
- Stabilize explicitly inferred const arguments (feature(generic_arg_infer))
- Stabilize the avx512 target features
- Stabilize kl and widekl target features for x86
- Stabilize sha512, sm3 and sm4 target features for x86
- Stabilize LoongArch target features f, d, frecipe, lasx, lbt, lsx, and lvz
- [Stabilize repr128 (#[repr(u128)], #[repr(i128)])](https://github.com/rust-lang/rust/pull/138285)
19 APIs stabilized
NonZero<char>, File::lock, File::lock_shared, File::try_lock, File::try_lock_shared, File::unlock, NonNull::from_ref, NonNull::from_mut, NonNull::without_provenance, NonNull::with_exposed_provenance, NonNull::expose_provenance, OsString::leak, PathBuf::leak, Result::flatten, std::os::linux::net::TcpStreamExt::quickack, std::os::linux::net::TcpStreamExt::set_quickack, <[T; N]>::as_mut_slice, <[u8]>::eq_ignore_ascii_case, str::eq_ignore_ascii_case
Can it break my build?
The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:
- Make
missing_fragment_specifieran unconditional error - Enabling the
neontarget feature onaarch64-unknown-none-softfloatcauses a warning because mixing code with and without that target feature is not properly supported by LLVM - Sized Hierarchy: Part I
- The warn-by-default
elided_named_lifetimeslint is superseded by the warn-by-defaultmismatched_lifetime_syntaxeslint. - Error on recursive opaque types earlier in the type checker
- Type inference side effects from requiring element types of array repeat expressions are
Copyare now only available at the end of type checking - The deprecated accidentally-stable
std::intrinsics::{copy,copy_nonoverlapping,write_bytes}are now proper intrinsics. There are no debug assertions guarding against UB, and they cannot be coerced to function pointers. - Remove long-deprecated
std::intrinsics::drop_in_place - Make well-formedness predicates no longer coinductive
- Remove hack when checking impl method compatibility
- Remove unnecessary type inference due to built-in trait object impls
- Lint against "stdcall", "fastcall", and "cdecl" on non-x86-32 targets
- Future incompatibility warnings relating to the never type (
!) are now reported in dependencies - Ensure
std::ptr::copy_*intrinsics also perform the static self-init checks extern "C"functions on thewasm32-unknown-unknowntarget now have a standards compliant ABI
Use it
rustup update stable # get the newest release
rustup install 1.89 # or exactly this one
rustup override set 1.89 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.89" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.
Full release notes
Language
- Stabilize explicitly inferred const arguments (
feature(generic_arg_infer)) - Add a warn-by-default
mismatched_lifetime_syntaxeslint. This lint detects when the same lifetime is referred to by different syntax categories between function arguments and return values, which can be confusing to read, especially in unsafe code. This lint supersedes the warn-by-defaultelided_named_lifetimeslint. - Expand
unpredictable_function_pointer_comparisonsto also lint on function pointer comparisons in external macros - Make the
dangerous_implicit_autorefslint deny-by-default - Stabilize the avx512 target features
- Stabilize
klandwidekltarget features for x86 - Stabilize
sha512,sm3andsm4target features for x86 - Stabilize LoongArch target features
f,d,frecipe,lasx,lbt,lsx, andlvz - Remove
i128andu128fromimproper_ctypes_definitions - [Stabilize
repr128(#[repr(u128)],#[repr(i128)])](https://github.com/rust-lang/rust/pull/138285) - [Allow
#![doc(test(attr(..)))]everywhere](https://github.com/rust-lang/rust/pull/140560) - Extend temporary lifetime extension to also go through tuple struct and tuple variant constructors
extern "C"functions on thewasm32-unknown-unknowntarget now have a standards compliant ABI
<a id="1.89.0-Compiler"></a>
Compiler
- Default to non-leaf frame pointers on aarch64-linux
- Enable non-leaf frame pointers for Arm64EC Windows
- Set Apple frame pointers by architecture
<a id="1.89.0-Platform-Support"></a>
Platform Support
- Add new Tier-3 targets
loongarch32-unknown-noneandloongarch32-unknown-none-softfloat x86_64-apple-darwinis in the process of being demoted to Tier 2 with host tools
Refer to Rust's platform support page for more information on Rust's tiered platform support.
<a id="1.89.0-Libraries"></a>
Libraries
- Specify the base path for
file! - Allow storing
format_args!()in a variable - [Add
#[must_use]to[T; N]::map](https://github.com/rust-lang/rust/pull/140957) - Implement
DerefMutforLazy{Cell,Lock} - Implement
Defaultforarray::IntoIter - Implement
Cloneforslice::ChunkBy - Implement
io::Seekforio::Take
<a id="1.89.0-Stabilized-APIs"></a>
Stabilized APIs
NonZero<char>- Many intrinsics for x86, not enumerated here
- AVX512 intrinsics
SHA512,SM3andSM4intrinsicsFile::lockFile::lock_sharedFile::try_lockFile::try_lock_sharedFile::unlockNonNull::from_refNonNull::from_mutNonNull::without_provenanceNonNull::with_exposed_provenanceNonNull::expose_provenanceOsString::leakPathBuf::leakResult::flattenstd::os::linux::net::TcpStreamExt::quickackstd::os::linux::net::TcpStreamExt::set_quickack
These previously stable APIs are now stable in const contexts:
- [
<[T; N]>::as_mut_slice](https://doc.rust-lang.org/stable/std/primitive.array.html#method.as_mut_slice) - [
<[u8]>::eq_ignore_ascii_case](https://doc.rust-lang.org/stable/std/primitive.slice.html#impl-%5Bu8%5D/method.eq_ignore_ascii_case) str::eq_ignore_ascii_case
<a id="1.89.0-Cargo"></a>
Cargo
cargo fixandcargo clippy --fixnow default to the same Cargo target selection as other build commands. Previously it would apply to all targets (like binaries, examples, tests, etc.). The--editionflag still applies to all targets.- Stabilize doctest-xcompile. Doctests are now tested when cross-compiling. Just like other tests, it will use the
runnersetting to run the tests. If you need to disable tests for a target, you can use the ignore doctest attribute to specify the targets to ignore.
<a id="1.89.0-Rustdoc"></a>
Rustdoc
- On mobile, make the sidebar full width and linewrap. This makes long section and item names much easier to deal with on mobile.
<a id="1.89.0-Compatibility-Notes"></a>
Compatibility Notes
- Make
missing_fragment_specifieran unconditional error - Enabling the
neontarget feature onaarch64-unknown-none-softfloatcauses a warning because mixing code with and without that target feature is not properly supported by LLVM - Sized Hierarchy: Part I
- Introduces a small breaking change affecting
?Sizedbounds on impls on recursive types which contain associated type projections. It is not expected to affect any existing published crates. Can be fixed by refactoring the involved types or opting into thesized_hierarchyunstable feature. See the FCP report for a code example. - The warn-by-default
elided_named_lifetimeslint is superseded by the warn-by-defaultmismatched_lifetime_syntaxeslint. - Error on recursive opaque types earlier in the type checker
- Type inference side effects from requiring element types of array repeat expressions are
Copyare now only available at the end of type checking - The deprecated accidentally-stable
std::intrinsics::{copy,copy_nonoverlapping,write_bytes}are now proper intrinsics. There are no debug assertions guarding against UB, and they cannot be coerced to function pointers. - Remove long-deprecated
std::intrinsics::drop_in_place - Make well-formedness predicates no longer coinductive
- Remove hack when checking impl method compatibility
- Remove unnecessary type inference due to built-in trait object impls
- Lint against "stdcall", "fastcall", and "cdecl" on non-x86-32 targets
- Future incompatibility warnings relating to the never type (
!) are now reported in dependencies - Ensure
std::ptr::copy_*intrinsics also perform the static self-init checks extern "C"functions on thewasm32-unknown-unknowntarget now have a standards compliant ABI
<a id="1.89.0-Internal-Changes"></a>
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.90Released Sep 18, 2025.Read it next →Also worth your time
Did this answer your question?