Change8

1.86.0

Breaking Changes
📦 rust-languageView on GitHub →
3 breaking24 features🐛 1 fixes2 deprecations🔧 44 symbols

Summary

This release stabilizes several useful APIs like `next_up`/`next_down` for floats and disjoint mutable slice access, introduces new compiler checks for double negations, and expands platform support with numerous new tier 3 targets. It also hardens error conditions related to `wasm_c_abi` and enum casting.

⚠️ Breaking Changes

  • The `wasm_c_abi` future compatibility warning is now a hard error. Users of `wasm-bindgen` must upgrade to at least version 0.2.89, or compilation will fail.
  • The future incompatibility lint `cenum_impl_drop_cast` has been made into a hard error. It is now an error to cast a field-less enum to an integer if the enum implements `Drop`.
  • SSE2 is now required for "i686" 32-bit x86 hard-float targets; disabling it causes a warning that will become a hard error eventually. To compile for pre-SSE2 32-bit x86, use a "i586" target instead.

Migration Steps

  1. If you use `wasm-bindgen`, upgrade it to version 0.2.89 or newer to avoid compilation failure due to the `wasm_c_abi` lint becoming a hard error.
  2. Review code that casts field-less enums implementing `Drop` to integers, as this is now a hard error.
  3. If compiling for 32-bit x86 hard-float targets and requiring pre-SSE2 support, switch the target triple to use "i586" instead of "i686".
  4. When merging Cargo configuration, be aware that keys referring to a program path and its arguments are now replaced rather than combined.
  5. If you rely on Cargo silently ignoring invocations where both `--package` and `--workspace` are passed but the package is missing, update your scripts as this now results in an error.

✨ New Features

  • Stabilized upcasting trait objects to supertraits.
  • Allow safe functions to be marked with the `#[target_feature]` attribute.
  • Rust now warns by default for the `missing_abi` lint.
  • Rust now lints about double negations directly (as `double_negations`), previously a `clippy::double_neg` lint.
  • More pointers are now detected as definitely not-null based on their alignment in const eval.
  • Empty `repr()` attribute applied to invalid items are now correctly rejected.
  • Inner attributes `#![test]` and `#![rustfmt::skip]` are no longer accepted in more places than intended.
  • Debug-assert that raw pointers are non-null on access.
  • Changed `-O` to mean `-C opt-level=3` instead of `-C opt-level=2` to match Cargo's defaults.
  • Replaced `i686-unknown-redox` target with `i586-unknown-redox`.
  • Increased baseline CPU of `i686-unknown-hurd-gnu` to Pentium 4.
  • Added new tier 3 targets: `{aarch64-unknown,x86_64-pc}-nto-qnx710_iosock`, `{aarch64-unknown,x86_64-pc}-nto-qnx800`, `{x86_64,i686}-win7-windows-gnu`, `amdgcn-amd-amdhsa`, `x86_64-pc-cygwin`, `{mips,mipsel}-mti-none-elf`, `m68k-unknown-none-elf`, and `{armv7a-nuttx-{eabi,eabihf}, aarch64-unknown-nuttx, thumbv7a-nuttx-{eabi,eabihf}}`.
  • The type of `FromBytesWithNulError` in `CStr::from_bytes_with_nul` is changed to an enum, allowing users to examine why conversion failed.
  • On recent versions of Windows, `std::fs::remove_file` will now remove read-only files.
  • Stabilized `{float}::next_down` and `{float}::next_up`.
  • Stabilized `<[_]>::get_disjoint_mut` and `<[_]>::get_disjoint_unchecked_mut`.
  • Stabilized `slice::GetDisjointMutError`.
  • Stabilized `HashMap::get_disjoint_mut` and `HashMap::get_disjoint_unchecked_mut`.
  • Stabilized `NonZero::count_ones`.
  • Stabilized `Vec::pop_if`.
  • Stabilized `sync::Once::wait`, `sync::Once::wait_force`, and `sync::OnceLock::wait`.
  • Stabilized `hint::black_box`, `io::Cursor::get_mut`, `io::Cursor::set_position`, and several `str` methods (`is_char_boundary`, `split_at`, `split_at_checked`, `split_at_mut`, `split_at_mut_checked`) in const contexts.
  • Cargo now errors if both `--package` and `--workspace` are passed but the requested package is missing.
  • Added a sans-serif font setting to Rustdoc.

🐛 Bug Fixes

  • Fixed emission of `overflowing_literals` under certain macro environments.

🔧 Affected Symbols

`missing_abi` lint`clippy::double_neg` lint`#[target_feature]``repr()` attribute`#![test]``#![rustfmt::skip]`raw pointers access`-O` flag`overflowing_literals``i686-unknown-redox` target`i586-unknown-redox` target`i686-unknown-hurd-gnu` target`CStr::from_bytes_with_nul``FromBytesWithNulError``RustcDecodable``RustcEncodable``--logfile` option (libtest)`std::fs::remove_file` (Windows)`f64::next_down``f64::next_up``[_]::get_disjoint_mut``[_]::get_disjoint_unchecked_mut``slice::GetDisjointMutError``HashMap::get_disjoint_mut``HashMap::get_disjoint_unchecked_mut``NonZero::count_ones``Vec::pop_if``sync::Once::wait``sync::Once::wait_force``sync::OnceLock::wait``hint::black_box``io::Cursor::get_mut``io::Cursor::set_position``str::is_char_boundary``str::split_at``str::split_at_checked``str::split_at_mut``str::split_at_mut_checked``cargo login` token argument`SourceID` comparisons (Cargo)`#![no_start]``#![crate_id]``cenum_impl_drop_cast` lint`i686` 32-bit x86 hard-float targets

⚡ Deprecations

  • The token argument in `cargo login` is deprecated to avoid shell history leaks.
  • libtest's `--logfile` option is deprecated.