Change8

1.97.0

Breaking Changes
📦 rust-languageView on GitHub →
3 breaking15 features🐛 3 fixes1 deprecations🔧 34 symbols

Summary

This release stabilizes several integer bit manipulation methods, stabilizes new Cargo configuration options like `build.warnings`, and drops support for older architectures on the nvptx64-nvidia-cuda target.

⚠️ Breaking Changes

  • Prevent deref coercions in `pin!`: writing `pin!(x)` where `x` has type `&mut T` now always produces `Pin<&mut &mut T>`, instead of potentially coercing to `Pin<&mut T>`. This was incorrectly allowed since Rust 1.88.0.
  • Error on `#[export_name = "..."]` where the name is empty.
  • Syntactically reject tuple index shorthands in struct patterns.

Migration Steps

  1. If you relied on deref coercion in `pin!(x)` where `x` was `&mut T`, update your code to explicitly handle the resulting `Pin<&mut &mut T>` type.
  2. Ensure that `#[export_name]` attributes do not use empty strings.
  3. Update struct pattern matching syntax to avoid tuple index shorthands if they were previously used.

✨ New Features

  • Consider `Result<T, Uninhabited>` and `ControlFlow<Uninhabited, T>` to be equivalent to `T` for must use lint.
  • Add allow-by-default `dead_code_pub_in_binary` lint for unused pub items in binary crates.
  • Stabilize the `div32`, `lam-bh`, `lamcas`, `ld-seq-sa` and `scq` target features.
  • Stabilize `cfg(target_has_atomic_primitive_alignment)`.
  • Allow trailing `self` in imports in more cases.
  • Stabilize `Default` for `RepeatN`.
  • Stabilize `Copy` for `ffi::FromBytesUntilNulError`.
  • Stabilize `Send` for `std::fs::File` on UEFI.
  • Stabilize integer methods: `isolate_highest_one`, `isolate_lowest_one`, `highest_one`, `lowest_one`, and `bit_width` for primitive integers and `NonZero<{integer}>`.
  • Stabilize `char::is_control` in const contexts.
  • Stabilize `build.warnings` config in Cargo, controlling how lint warnings from local packages are treated.
  • Stabilize `resolver.lockfile-path` config in Cargo, allowing specification of the lockfile path.
  • Add `-m` shorthand for `--manifest-path` in Cargo.
  • Stabilize `--emit` flag in Rustdoc.
  • Stabilize `--remap-path-prefix` in Rustdoc.

🐛 Bug Fixes

  • Cargo `cargo-clean`: Error when `--target-dir` doesn't look like a Cargo target directory to prevent accidental deletion of non-target directories.
  • Remove `curl` dependency from `crates-io` crate in Cargo.
  • Map `WSAESHUTDOWN` to `io::ErrorKind::BrokenPipe` on Windows, so attempting to write after socket shutdown yields `BrokenPipe` instead of `Other`.

Affected Symbols

⚡ Deprecations

  • Deprecate `std::char` constants and functions.