Rust versions / 1.97
Rust release · Jul 9, 2026
Rust 1.97: what's new, what was stabilized
Short answerRust 1.97 was released on Jul 9, 2026: 2 language stabilizations (Stabilize the div32, lam-bh, lamcas, ld-seq-sa and scq target features); 14 newly stable APIs (Default for RepeatN, Copy for ffi::FromBytesUntilNulError, Send for std::fs::File, <{integer}>::isolate_highest_one, ...); 14 compatibility notes that can affect existing code. Point release: 1.97.1 (Jul 16, 2026).
← Rust 1.96All versionsRust 1.98 →
Language features stabilized
- Stabilize the div32, lam-bh, lamcas, ld-seq-sa and scq target features
- Stabilize cfg(target_has_atomic_primitive_alignment)
14 APIs stabilized
Default for RepeatN, Copy for ffi::FromBytesUntilNulError, Send for std::fs::File, <{integer}>::isolate_highest_one, <{integer}>::isolate_lowest_one, <{integer}>::highest_one, <{integer}>::lowest_one, <{integer}>::bit_width, NonZero<{integer}>::isolate_highest_one, NonZero<{integer}>::isolate_lowest_one, NonZero<{integer}>::highest_one, NonZero<{integer}>::lowest_one, NonZero<{integer}>::bit_width, char::is_control
Can it break my build?
The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:
- Emit a future-compatibility warning when relying on
f32: From<{float}>to constrain{float} - Rust will use the v0 symbol mangling scheme by default. This may cause some tools (such as debuggers or profilers, especially with old versions) to fail to demangle symbols emitted by Rust. It may also cause the formatting of text in backtraces to change.
- Prevent deref coercions in
pin!, in order to prevent unsoundness. The most likely case where this might impact users is: writingpin!(x)wherexhas type&mut Twill now always correctly produce a value of typePin<&mut &mut T>, instead of sometimes allowing a coercion that produces a value of typePin<&mut T>. This coercion was previously incorrectly allowed since Rust 1.88.0. - Deprecate
std::charconstants and functions - Warn on linker output by default
- Remove hidden
f64methods which have been deprecated since 1.0 - report the
varargs_without_patternlint in deps - Forbid passing generic arguments to module path segments even if the module reexports a generic enum variant
- Error on invalid macho
link_sectionspecifier - The encoding of certain
enums have changed. This is not a breaking change, as it only applies toenums without layout guarantees, but is noted here as we've seen people impacted from having made assumptions about the layout algorithm. - [Error on
#[export_name = "..."]where the name is empty](https://github.com/rust-lang/rust/pull/155515) - Syntactically reject tuple index shorthands in struct patterns
- [validate
#[link_name = "..."]&#[link(name = "...")]parameters](https://github.com/rust-lang/rust/pull/155817) - On Windows, after calling
shutdownon a socket to shut down the write side, attempting to write to the socket will now produce aBrokenPipeerror rather thanOther. MapWSAESHUTDOWNtoio::ErrorKind::BrokenPipe
Use it
rustup update stable # get the newest release
rustup install 1.97 # or exactly this one
rustup override set 1.97 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.97" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.
Full release notes
Language
- Consider
Result<T, Uninhabited>andControlFlow<Uninhabited, T>to be equivalent toTfor must use lint - Add allow-by-default
dead_code_pub_in_binarylint for unused pub items in binary crates - Stabilize the
div32,lam-bh,lamcas,ld-seq-saandscqtarget features - Stabilize
cfg(target_has_atomic_primitive_alignment) - Allow trailing
selfin imports in more cases
<a id="1.97.0-Platform-Support"></a>
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
<a id="1.97.0-Stabilized-APIs"></a>
Stabilized APIs
Default for RepeatNCopy for ffi::FromBytesUntilNulErrorSend for std::fs::Fileon UEFI<{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_width
These previously stable APIs are now stable in const contexts:
<a id="1.97.0-Cargo"></a>
Cargo
- Stabilize
build.warningsconfig. This controls how lint warnings from local packages are treated. Useful for enforcing a warning-free build in CI, replacing-Dwarnings. docs - Stabilize
resolver.lockfile-pathconfig. This allows specifying the path to the lockfile to use when resolving dependencies. Useful when working with read-only source directories. docs - cargo-clean: Error when
--target-dirdoesn't look like a Cargo target directory. This prevents accidental deletion of non-target directories. - Add
-mshorthand for--manifest-path - Remove
curldependency fromcrates-iocrate
<a id="1.97.0-Rustdoc"></a>
Rustdoc
<a id="1.97.0-Compatibility-Notes"></a>
Compatibility Notes
- Emit a future-compatibility warning when relying on
f32: From<{float}>to constrain{float} - Rust will use the v0 symbol mangling scheme by default. This may cause some tools (such as debuggers or profilers, especially with old versions) to fail to demangle symbols emitted by Rust. It may also cause the formatting of text in backtraces to change.
- Prevent deref coercions in
pin!, in order to prevent unsoundness. The most likely case where this might impact users is: writingpin!(x)wherexhas type&mut Twill now always correctly produce a value of typePin<&mut &mut T>, instead of sometimes allowing a coercion that produces a value of typePin<&mut T>. This coercion was previously incorrectly allowed since Rust 1.88.0. - Deprecate
std::charconstants and functions - Warn on linker output by default
- Remove hidden
f64methods which have been deprecated since 1.0 - report the
varargs_without_patternlint in deps - Forbid passing generic arguments to module path segments even if the module reexports a generic enum variant
- Error on invalid macho
link_sectionspecifier - The encoding of certain
enums have changed. This is not a breaking change, as it only applies toenums without layout guarantees, but is noted here as we've seen people impacted from having made assumptions about the layout algorithm. - [Error on
#[export_name = "..."]where the name is empty](https://github.com/rust-lang/rust/pull/155515) - Syntactically reject tuple index shorthands in struct patterns
- [validate
#[link_name = "..."]&#[link(name = "...")]parameters](https://github.com/rust-lang/rust/pull/155817) - On Windows, after calling
shutdownon a socket to shut down the write side, attempting to write to the socket will now produce aBrokenPipeerror rather thanOther. MapWSAESHUTDOWNtoio::ErrorKind::BrokenPipe
1.97.1 (Jul 16, 2026)
<a id="1.97.1"></a>
- rustc: Fix miscompilation in LLVM optimization This backports an LLVM submodule bump to include the LLVM-side fix and a revert of the rustc change that is one known trigger for the bug. The rustc side revert should not be strictly necessary but is done out of abundance of caution.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.98Released Aug 20, 2026.Read it next →Also worth your time
Did this answer your question?