Change8

1.93.0

Breaking Changes
📦 rust-languageView on GitHub →
3 breaking9 features🐛 7 fixes🔧 33 symbols

Summary

This release stabilizes several language features, introduces new stabilized APIs for slices, strings, and collections, and updates compiler flags and platform support. It also includes important compatibility changes regarding the `#[test]` attribute enforcement and changes in Cargo's environment variable setting.

⚠️ Breaking Changes

  • Stop internally using `specialization` on the `Copy` trait because it is unsound with lifetime dependent `Copy` implementations. This may cause performance regressions as some standard library APIs might now call `Clone::clone` instead of bitwise copies.
  • The `#[test]` attribute is no longer ignored when applied to trait methods or types, resulting in an error instead. This might cause errors when generating rustdoc.
  • Cargo now sets the `CARGO_CFG_DEBUG_ASSERTIONS` environment variable in more situations, causing crates depending on `static-init` versions 1.0.1 to 1.0.3 to fail compilation with "failed to resolve: use of unresolved module or unlinked crate `parking_lot`".

Migration Steps

  1. If linking C/C++ object files with Rust objects compiled with `panic=unwind` on Emscripten, pass `-fwasm-exceptions` to the linker.
  2. Review usage of the `#[test]` attribute on trait methods or types, as it will now cause errors.
  3. If using `static-init` versions 1.0.1 to 1.0.3, update them to resolve compilation failures related to `CARGO_CFG_DEBUG_ASSERTIONS` changes.

✨ New Features

  • Stabilized several s390x `vector`-related target features and the `is_s390x_feature_detected!` macro.
  • Stabilized declaration of C-style variadic functions for the `system` ABI.
  • Stabilized `asm_cfg`.
  • Stabilize `-Cjump-tables=bool` (previously `-Zno-jump-tables`).
  • Promote `riscv64a23-unknown-linux-gnu` to Tier 2 (without host tools).
  • Stabilized `[MaybeUninit<T>]::assume_init_drop`, `[MaybeUninit<T>]::assume_init_ref`, `[MaybeUninit<T>]::assume_init_mut`, `[MaybeUninit<T>]::write_copy_of_slice`, `[MaybeUninit<T>]::write_clone_of_slice`, `String::into_raw_parts`, `Vec::into_raw_parts`, integer unchecked negation/shift methods (`unchecked_neg`, `unchecked_shl`, `unchecked_shr`), slice array conversion methods (`as_array`, `as_array_mut`, pointer array conversion methods, `VecDeque::pop_front_if`, `VecDeque::pop_back_if`, `Duration::from_nanos_u128`, `char::MAX_LEN_UTF8`, `char::MAX_LEN_UTF16`, `std::fmt::from_fn`, and `std::fmt::FromFn`).
  • Enable `CARGO_CFG_DEBUG_ASSERTIONS` in build scripts based on profile.
  • In `cargo tree`, support long forms for `--format` variables.
  • Add `--workspace` to `cargo clean`.

🐛 Bug Fixes

  • During const-evaluation, support copying pointers byte-by-byte.
  • LUB coercions now correctly handle function item types, and functions with differing safeties.
  • Add warn-by-default `const_item_interior_mutations` lint to warn against calls which mutate interior mutable `const` items.
  • Add warn-by-default `function_casts_as_integer` lint.
  • Allow the global allocator to use thread-local storage and `std::thread::current()`.
  • Make `BTree::append` not update existing keys when appending an entry which already exists.
  • Don't require `T: RefUnwindSafe` for `vec::IntoIter<T>: UnwindSafe`.

Affected Symbols