Rust 1.97.0
Rust 1.97.0 just shipped — and it is packed with polish, platform updates, and powerful new primitives for the integer set.
Language Lift
- Must-Use Smarter —
Result<T, Uninhabited>andControlFlow<Uninhabited, T>now count as equivalent toTfor must-use lint purposes, eliminating false positives in generic code. - Dead Code Detective — New allow-by-default
dead_code_pub_in_binarylint catches unusedpubitems specifically in binary crates, keeping library boundaries clean. - Trailing Self — Trailing
selfin imports now works in more scenarios, making use statements more intuitive and reducing friction when reorganizing modules.
Platform Push
- Target Features Stabilized —
div32,lam-bh,lamcas,ld-seq-sa, andscqtarget features are now stable for use incfg!andtarget_featureattributes. - Atomic Alignment —
cfg(target_has_atomic_primitive_alignment)enables conditional compilation based on atomic alignment guarantees for more portable low-level code. - CUDA Cleanup — The
nvptx64-nvidia-cudatarget drops support for old architectures and old ISAs, streamlining the maintainability of the NVPTX backend.
Stabilized API Stack
Default for RepeatN— Iterator repeat helper now implements Default.Copy for ffi::FromBytesUntilNulError— Error type gains Copy semantics for ergonomic error handling.Send for Fileon UEFI — File handles are now Send on UEFI targets.- Integer Bit Gymnastics —
isolate_highest_one,isolate_lowest_one,highest_one,lowest_one, andbit_widthland on all integer types for direct bit-manipulation without external crates.
Upgrade when you are ready — but with no major breaking changes and a hefty batch of stabilizations, there is little reason to wait. Run rustup update stable and get 1.97.0 today.