1.89.0
Breaking Changes📦 rust-language
⚠ 2 breaking✨ 18 features🐛 9 fixes⚡ 1 deprecations🔧 56 symbols
Summary
This release stabilizes many language features, including generic argument inference and `repr(u128)`, stabilizes numerous APIs like file locking and `NonNull` methods, and introduces new Tier-3 targets for LoongArch.
⚠️ Breaking Changes
- The `missing_fragment_specifier` lint is now an unconditional error.
- A small breaking change affects `?Sized` bounds on impls on recursive types which contain associated type projections due to the Sized Hierarchy changes. Fix by refactoring involved types or opting into the `sized_hierarchy` unstable feature.
Migration Steps
- If you rely on the behavior of the now-removed `elided_named_lifetimes` lint, ensure your code adheres to the new `mismatched_lifetime_syntaxes` lint rules.
- If you encounter issues with `?Sized` bounds on impls involving recursive types with associated type projections, refactor the involved types or consider opting into the `sized_hierarchy` unstable feature.
- If you use `cargo fix` or `cargo clippy --fix`, note that they now default to the same Cargo target selection as other build commands (i.e., they no longer apply to all targets by default unless `--edition` is used).
✨ New Features
- Explicitly inferred const arguments (`feature(generic_arg_infer)`) are stabilized.
- Stabilized `avx512` target features.
- Stabilized `kl` and `widekl` target features for x86.
- Stabilized `sha512`, `sm3` and `sm4` target features for x86.
- Stabilized LoongArch target features `f`, `d`, `frecipe`, `lasx`, `lbt`, `lsx`, and `lvz`.
- Stabilized `repr128` (`#[repr(u128)]`, `#[repr(i128)]`).
- Allow `#![doc(test(attr(..)))]` everywhere.
- Extended temporary lifetime extension to also go through tuple struct and variant constructors.
- Stabilized doctest-xcompile in Cargo, allowing doctests to run when cross-compiling.
- Stabilized `NonZero<char>`.
- Stabilized AVX512 intrinsics.
- Stabilized `SHA512`, `SM3` and `SM4` intrinsics.
- Stabilized `File::lock`, `File::lock_shared`, `File::try_lock`, `File::try_lock_shared`, and `File::unlock`.
- Stabilized `NonNull::from_ref`, `NonNull::from_mut`, `NonNull::without_provenance`, `NonNull::with_exposed_provenance`, and `NonNull::expose_provenance`.
- Stabilized `OsString::leak` and `PathBuf::leak`.
- Stabilized `Result::flatten`.
- Stabilized `std::os::linux::net::TcpStreamExt::quickack` and `std::os::linux::net::TcpStreamExt::set_quickack`.
- The APIs `<[T; N]>::as_mut_slice`, `<[u8]>::eq_ignore_ascii_case`, and `str::eq_ignore_ascii_case` are now stable in const contexts.
🐛 Bug Fixes
- Removed `i128` and `u128` from `improper_ctypes_definitions`.
- Added a warn-by-default `mismatched_lifetime_syntaxes` lint to detect confusing lifetime syntax usage.
- Expanded `unpredictable_function_pointer_comparisons` to lint on function pointer comparisons in external macros.
- Made the `dangerous_implicit_autorefs` lint deny-by-default.
- Added `#[must_use]` to `[T; N]::map`.
- Implemented `DerefMut` for `Lazy{Cell,Lock}`.
- Implemented `Default` for `array::IntoIter`.
- Implemented `Clone` for `slice::ChunkBy`.
- Implemented `io::Seek` for `io::Take`.
🔧 Affected Symbols
generic_arg_infermismatched_lifetime_syntaxeselided_named_lifetimesunpredictable_function_pointer_comparisonsdangerous_implicit_autorefsavx512klwideklsha512sm3sm4fdfrecipelasxlbtlsxlvzi128u128improper_ctypes_definitionsrepr128doc(test(attr(..)))tuple struct constructorstuple variant constructorsextern "C"wasm32-unknown-unknownaarch64-linuxArm64EC Windowsx86_64-apple-darwinfile![T; N]::mapLazyCellLazyLockarray::IntoIterslice::ChunkByio::TakeNonZero<char>File::lockFile::lock_sharedFile::try_lockFile::try_lock_sharedFile::unlockNonNull::from_refNonNull::from_mutNonNull::without_provenanceNonNull::with_exposed_provenanceNonNull::expose_provenanceOsString::leakPathBuf::leakResult::flattenTcpStreamExt::quickackTcpStreamExt::set_quickack<[T; N]>::as_mut_slice<[u8]>::eq_ignore_ascii_casestr::eq_ignore_ascii_case⚡ Deprecations
- The warn-by-default `elided_named_lifetimes` lint is superseded by the warn-by-default `mismatched_lifetime_syntaxes` lint.