1.88.0
Breaking Changes📦 rust-languageView on GitHub →
⚠ 3 breaking✨ 15 features🐛 3 fixes⚡ 1 deprecations🔧 31 symbols
Summary
This release stabilizes several language features like `let_chains` and `naked_functions`, stabilizes numerous APIs including `extract_if` for collections and new slice chunking methods, and introduces breaking changes related to the removal of the `#[bench]` attribute and stricter borrow checking.
⚠️ Breaking Changes
- The `#[bench]` attribute is fully de-stabilized. Usage without `#![feature(custom_test_frameworks)]` which previously triggered a deny-by-default lint since Rust 1.77, will now result in a hard compilation error.
- The borrow checker is stricter regarding always-true patterns, rejecting programs that were previously accepted due to overly permissive checking. Fix by reviewing patterns where borrow checking failed.
- It is now a hard error to use a vector type with a non-Rust ABI unless the required target feature is enabled.
Migration Steps
- If you were using the deprecated libtest flag `--nocapture`, update your test invocation to use `--no-capture` instead.
- If your code relied on previously accepted invalid declarative macros, you may need to update them, potentially using a `tt` fragment specifier to fix compilation errors.
- If you use vector types with non-Rust ABIs, ensure the required target feature is enabled or switch to a Rust ABI.
- If you were using the `#[bench]` attribute without `#![feature(custom_test_frameworks)]`, you must either enable that feature or remove the attribute as it is now a hard error.
✨ New Features
- Stabilized `#![feature(let_chains)]` in the 2024 edition, allowing `&&`-chaining of `let` statements inside `if` and `while`.
- Stabilized `#![feature(naked_functions)]`, enabling writing functions with no compiler-generated epilogue/prologue for full assembly control.
- Stabilized `#![feature(cfg_boolean_literals)]`, allowing boolean literals (e.g., `#[cfg(true)]`) as `cfg` predicates.
- Stabilized `Cell::update`.
- Stabilized `impl Default for *const T` and `impl Default for *mut T`.
- Stabilized `HashMap::extract_if` and `HashSet::extract_if`.
- Stabilized `hint::select_unpredictable`.
- Stabilized `proc_macro::Span` methods: `line`, `column`, `start`, `end`, `file`, and `local_file`.
- Stabilized slice methods: `<[T]>::as_chunks`, `<[T]>::as_chunks_mut`, `<[T]>::as_chunks_unchecked`, `<[T]>::as_chunks_unchecked_mut`, `<[T]>::as_rchunks`, and `<[T]>::as_rchunks_mut`.
- Stabilized `mod ffi::c_str`.
- Stabilized `NonNull<T>::replace`, `<*mut T>::replace`, `std::ptr::swap_nonoverlapping`, `Cell::replace`, `Cell::get`, `Cell::get_mut`, `Cell::from_mut`, and `Cell::as_slice_of_cells` in const contexts.
- Stabilized automatic garbage collection in Cargo.
- Cargo now uses `zlib-rs` for gzip compression in Rust code.
- Doctests can now be ignored based on target names using `ignore-*` attributes.
- Stabilized the `--test-runtool` and `--test-runtool-arg` CLI options for rustdoc to specify a program and its arguments for running doctests.
🐛 Bug Fixes
- Removed backticks from `#[should_panic]` test failure messages.
- Guaranteed that `[T; N]::from_fn` generates elements in order of increasing indices, even with stateful closures.
- Guaranteed that `{float}::NAN` is a quiet NaN.
🔧 Affected Symbols
#[bench]#[cfg(true)]#[cfg(false)]Cell::updateCell::replaceCell::getCell::get_mutCell::from_mutCell::as_slice_of_cellsHashMap::extract_ifHashSet::extract_ifhint::select_unpredictableproc_macro::Span::lineproc_macro::Span::columnproc_macro::Span::startproc_macro::Span::endproc_macro::Span::fileproc_macro::Span::local_file[T]::as_chunks[T]::as_chunks_mut[T]::as_chunks_unchecked[T]::as_chunks_unchecked_mut[T]::as_rchunks[T]::as_rchunks_mutffi::c_strNonNull<T>::replace*mut T::replacestd::ptr::swap_nonoverlapping[T; N]::from_fnlibtest --nocapturelibtest --no-capture⚡ Deprecations
- The libtest flag `--nocapture` is deprecated in favor of the more consistent `--no-capture` flag.