1.97.0
Breaking Changes📦 rust-languageView on GitHub →
⚠ 3 breaking✨ 15 features🐛 3 fixes⚡ 1 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
- 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.
- Ensure that `#[export_name]` attributes do not use empty strings.
- 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
Result<T, Uninhabited>ControlFlow<Uninhabited, T>dead_code_pub_in_binary (lint)div32 (target feature)lam-bh (target feature)lamcas (target feature)ld-seq-sa (target feature)scq (target feature)cfg(target_has_atomic_primitive_alignment)RepeatNffi::FromBytesUntilNulErrorstd::fs::File<{integer}>::isolate_highest_one<{integer}>::isolate_lowest_one<{integer}>::highest_one<{integer}>::lowest_one<{integer}>::bit_widthNonZero<{integer}>::isolate_highest_oneNonZero<{integer}>::isolate_lowest_oneNonZero<{integer}>::highest_oneNonZero<{integer}>::lowest_oneNonZero<{integer}>::bit_widthchar::is_controlbuild.warnings (Cargo config)resolver.lockfile-path (Cargo config)cargo-clean--target-dir--manifest-path--emit (Rustdoc flag)--remap-path-prefix (Rustdoc flag)#[export_name]#[link_name]#[link(name = "...")]tuple index shorthands in struct patterns
⚡ Deprecations
- Deprecate `std::char` constants and functions.