Change8

1.85.0

Breaking Changes
📦 rust-languageView on GitHub →
2 breaking21 features🐛 4 fixes1 deprecations🔧 39 symbols

Summary

This release stabilizes the Rust 2024 Edition and async closures, alongside numerous API stabilizations and compiler improvements. A key compatibility change involves how `core::ffi::c_char` signedness is determined and how the `test` cfg is handled.

⚠️ Breaking Changes

  • The unstable flag `-Zpolymorphize` has been removed. Users relying on this flag must update their build process or code.
  • The signedness of `core::ffi::c_char` now more closely matches the platform-default `char` on many Tier 2 and 3 targets (mostly Arm and RISC-V embedded targets). This may cause compilation failures if code relied on the previous fixed size/signedness (e.g., assuming it was always i8).

Migration Steps

  1. If you were using the unstable flag `-Zpolymorphize`, remove it from your build configuration.
  2. Review code that interacts with `core::ffi::c_char` on Tier 2/3 targets (especially Arm/RISC-V embedded) as its signedness may have changed.
  3. If you rely on Cargo's behavior regarding the `test` cfg, note that `rustc` no longer treats it as well known by default; ensure your build system (like Cargo) correctly sets it via `--check-cfg=cfg(test)` if needed.

✨ New Features

  • The 2024 Edition is now stable.
  • Stabilized async closures.
  • Stabilized `#[diagnostic::do_not_recommend]` attribute.
  • Added `unpredictable_function_pointer_comparisons` lint to warn against function pointer comparisons.
  • Added lint on combining `#[no_mangle]` and `#[export_name]` attributes.
  • Promoted `powerpc64le-unknown-linux-musl` to tier 2 with host tools.
  • Added `AsyncFn*` to the prelude in all editions.
  • Stabilized `BuildHasherDefault::new`.
  • Stabilized `ptr::fn_addr_eq`.
  • Stabilized `io::ErrorKind::QuotaExceeded`.
  • Stabilized `io::ErrorKind::CrossesDevices`.
  • Stabilized `{float}::midpoint`.
  • Stabilized Unsigned `{integer}::midpoint`.
  • Stabilized `NonZeroU*::midpoint`.
  • Stabilized `std::iter::Extend` for tuples with arity 1 through 12.
  • Stabilized `FromIterator<(A, ...)>` for tuples with arity 1 through 12.
  • Stabilized `std::task::Waker::noop`.
  • Several APIs are now stable in const contexts, including `mem::size_of_val`, `Layout::for_value`, `NonNull::new`, and various float methods.
  • Cargo stabilized higher precedence trailing flags.
  • Cargo now passes `CARGO_CFG_FEATURE` to build scripts.
  • Rustdoc now shows the first line of doc comments on collapsed impl blocks.

🐛 Bug Fixes

  • Panics in the standard library now have a leading `library/` in their path.
  • `std::env::home_dir()` on Windows now ignores the non-standard `$HOME` environment variable (this is treated as a bug fix for surprising behavior).
  • Disabled potentially incorrect type inference if there are trivial and non-trivial where-clauses.
  • When compiling a nested `macro_rules` macro from an external crate, the content of the inner `macro_rules` is now built with the edition of the external crate, not the local crate.

🔧 Affected Symbols

std::env::home_dircore::ffi::c_char-Zpolymorphizetest cfgstd::hash::BuildHasherDefault::newstd::ptr::fn_addr_eqstd::io::ErrorKind::QuotaExceededstd::io::ErrorKind::CrossesDevicesf32::midpointu64::midpointNonZeroU*std::iter::Extendstd::iter::FromIteratorstd::task::Waker::noopstd::mem::size_of_valstd::mem::align_of_valstd::alloc::Layout::for_valuestd::alloc::Layout::align_tostd::alloc::Layout::pad_to_alignstd::alloc::Layout::extendstd::alloc::Layout::arraystd::mem::swapstd::ptr::swapstd::ptr::NonNull::newstd::collections::HashMap::with_hasherstd::collections::HashSet::with_hasherf32::recipf32::to_degreesf32::to_radiansf32::maxf32::minf32::clampf32::absf32::signumf32::copysignstd::mem::MaybeUninit::write#[diagnostic::do_not_recommend]#[no_mangle]#[export_name]

⚡ Deprecations

  • `std::env::home_dir()` on Windows is still deprecated but its behavior regarding the `$HOME` environment variable has been fixed (it now ignores non-standard `$HOME`). The deprecation will be removed in a subsequent release.