Rust versions / 1.68
Rust release · Mar 9, 2023
Rust 1.68: what's new, what was stabilized
Short answerRust 1.68 was released on Mar 9, 2023: 2 language stabilizations (Stabilize default_alloc_error_handler); 5 newly stable APIs ({core,std}::pin::pin!, impl From<bool> for {f32,f64}, std::path::MAIN_SEPARATOR_STR, impl DerefMut for PathBuf, ...); 5 compatibility notes that can affect existing code. Point releases: 1.68.1 (Mar 23, 2023), 1.68.2 (Mar 28, 2023).
← Rust 1.67All versionsRust 1.69 →
Language features stabilized
- Stabilize default_alloc_error_handler
- Stabilize efiapi calling convention.
5 APIs stabilized
{core,std}::pin::pin!, impl From<bool> for {f32,f64}, std::path::MAIN_SEPARATOR_STR, impl DerefMut for PathBuf, VecDeque::new
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:
Use it
rustup update stable # get the newest release
rustup install 1.68 # or exactly this one
rustup override set 1.68 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.68" 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
- Stabilize default_alloc_error_handler This allows usage of
allocon stable without requiring the definition of a handler for allocation failure. Defining custom handlers is still unstable. - Stabilize
efiapicalling convention. - Remove implicit promotion for types with drop glue
<a id="1.68.0-Compiler"></a>
Compiler
- Change
bindings_with_variant_nameto deny-by-default - Allow .. to be parsed as let initializer
- Add
armv7-sony-vita-newlibeabihfas a tier 3 target - Always check alignment during compile-time const evaluation
- Disable "split dwarf inlining" by default.
- Add vendor to Fuchsia's target triple
- Enable sanitizers for s390x-linux
<a id="1.68.0-Libraries"></a>
Libraries
- Loosen the bound on the Debug implementation of Weak.
- Make
std::task::Context!Send and !Sync - PhantomData layout guarantees
- Don't derive Debug for
OnceWith&RepeatWith - Implement DerefMut for PathBuf
- Add O(1)
Vec -> VecDequeconversion guarantee - Leak amplification for peek_mut() to ensure BinaryHeap's invariant is always met
<a id="1.68.0-Stabilized-APIs"></a>
Stabilized APIs
{core,std}::pin::pin!impl From<bool> for {f32,f64}std::path::MAIN_SEPARATOR_STRimpl DerefMut for PathBuf
These APIs are now stable in const contexts:
<a id="1.68.0-Cargo"></a>
Cargo
- Stabilize sparse registry support for crates.io
cargo build --verbosetells you more about why it recompiles.- Show progress of crates.io index update even
net.git-fetch-with-clioption enabled
<a id="1.68.0-Misc"></a>
Misc
<a id="1.68.0-Compatibility-Notes"></a>
Compatibility Notes
- Only support Android NDK 25 or newer
- Add
SEMICOLON_IN_EXPRESSIONS_FROM_MACROSto future-incompat report - Only specify
--targetby default for-Zgcc-ld=lldon wasm - Bump
IMPLIED_BOUNDS_ENTAILMENTto Deny + ReportNow std::task::Contextno longer implements Send and Sync
<a id="1.68.0-Internal-Changes"></a>
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
- Encode spans relative to the enclosing item
- Don't normalize in AstConv
- Find the right lower bound region in the scenario of partial order relations
- Fix impl block in const expr
- Check ADT fields for copy implementations considering regions
- rustdoc: simplify JS search routine by not messing with lev distance
- Enable ThinLTO for rustc on
x86_64-pc-windows-msvc - Enable ThinLTO for rustc on
x86_64-apple-darwin
1.68.1 (Mar 23, 2023)
- Fix miscompilation in produced Windows MSVC artifacts This was introduced by enabling ThinLTO for the distributed rustc which led to miscompilations in the resulting binary. Currently this is believed to be limited to the -Zdylib-lto flag used for rustc compilation, rather than a general bug in ThinLTO, so only rustc artifacts should be affected.
- Fix --enable-local-rust builds
- Treat
$prefix-clangasclangin linker detection code - Fix panic in compiler code
1.68.2 (Mar 28, 2023)
- Update the GitHub RSA host key bundled within Cargo. The key was rotated by GitHub on 2023-03-24 after the old one leaked.
- Mark the old GitHub RSA host key as revoked. This will prevent Cargo from accepting the leaked key even when trusted by the system.
- Add support for
@revokedand a better error message for@cert-authorityin Cargo's SSH host key verification
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.69Released Apr 20, 2023.Read it next →Also worth your time
Did this answer your question?