Releases: rust-lang/rust
Rust 1.72.1
- Adjust codegen change to improve LLVM codegen
- rustdoc: Fix self ty params in objects with lifetimes
- Fix regression in compile times
- Resolve some ICE regressions in the compiler:
Rust 1.72.0
Language
- Replace const eval limit by a lint and add an exponential backoff warning
- expand: Change how
#![cfg(FALSE)]behaves on crate root - Stabilize inline asm for LoongArch64
- Uplift
clippy::undropped_manually_dropslint - Uplift
clippy::invalid_utf8_in_uncheckedlint asinvalid_from_utf8_uncheckedandinvalid_from_utf8 - Uplift
clippy::cast_ref_to_mutlint asinvalid_reference_casting - Uplift
clippy::cmp_nanlint asinvalid_nan_comparisons - resolve: Remove artificial import ambiguity errors
- Don't require associated types with Self: Sized bounds in
dyn Traitobjects
Compiler
- Remember names of
cfg-ed out items to mention them in diagnostics - Support for native WASM exceptions
- Add support for NetBSD/aarch64-be (big-endian arm64).
- Write to stdout if
-is given as output file - Force all native libraries to be statically linked when linking a static binary
- Add Tier 3 support for
loongarch64-unknown-none* - Prevent
.eh_framefrom being emitted for-C panic=abort - Support 128-bit enum variant in debuginfo codegen
- compiler: update solaris/illumos to enable tsan support.
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Document memory orderings of
thread::{park, unpark} - io: soften ‘at most one write attempt’ requirement in io::Write::write
- Specify behavior of HashSet::insert
- Relax implicit
T: Sizedbounds onBufReader<T>,BufWriter<T>andLineWriter<T> - Update runtime guarantee for
select_nth_unstable - Return
Okon kill if process has already exited - Implement PartialOrd for
Vecs over different allocators - Use 128 bits for TypeId hash
- Don't drain-on-drop in DrainFilter impls of various collections.
- Make
{Arc,Rc,Weak}::ptr_eqignore pointer metadata
Rustdoc
- Allow whitespace as path separator like double colon
- Add search result item types after their name
- Search for slices and arrays by type with
[] - Clean up type unification and "unboxing"
Stabilized APIs
These APIs are now stable in const contexts:
Cargo
- Enable
-Zdoctest-in-workspaceby default. When running each documentation test, the working directory is set to the root directory of the package the test belongs to. docs #12221 #12288 - Add support of the "default" keyword to reset previously set
build.jobsparallelism back to the default. #12222
Compatibility Notes
- Alter
DisplayforIpv6Addrfor IPv4-compatible addresses - Cargo changed feature name validation check to a hard error. The warning was added in Rust 1.49. These extended characters aren't allowed on crates.io, so this should only impact users of other registries, or people who don't publish to a registry. #12291
- Demoted
mips*-unknown-linux-gnu*targets from host tier 2 to target tier 3 support.
Rust 1.71.1
- Fix CVE-2023-38497: Cargo did not respect the umask when extracting dependencies
- Fix bash completion for users of Rustup
- Do not show
suspicious_double_ref_oplint when callingborrow() - Fix ICE: substitute types before checking inlining compatibility
- Fix ICE: don't use
can_eqinderive(..)suggestion for missing method - Fix building Rust 1.71.0 from the source tarball
Rust 1.71.0
Language
- Stabilize
raw-dylib,link_ordinal,import_name_typeand-Cdlltool. - Uplift
clippy::{drop,forget}_{ref,copy}lints. - Type inference is more conservative around constrained vars.
- Use fulfillment to check
Dropimpl compatibility
Compiler
- Evaluate place expression in
PlaceMention, makinglet _ =patterns more consistent with respect to the borrow checker. - Add
--print deployment-targetflag for Apple targets. - Stabilize
extern "C-unwind"and friends. The existingextern "C"etc. may change behavior for cross-language unwinding in a future release. - Update the version of musl used on
*-linux-musltargets to 1.2.3, enabling time64 on 32-bit systems. - Stabilize
debugger_visualizerfor embedding metadata like Microsoft's Natvis. - Enable flatten-format-args by default.
- Make
Selfrespect tuple constructor privacy. - Improve niche placement by trying two strategies and picking the better result.
- Use
apple-m1as the target CPU foraarch64-apple-darwin. - Add Tier 3 support for the
x86_64h-apple-darwintarget. - Promote
loongarch64-unknown-linux-gnuto Tier 2 with host tools.
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Rework handling of recursive panics. Additional panics are allowed while unwinding, as long as they are caught before escaping a
Dropimplementation, but panicking within a panic hook is now an immediate abort. - Loosen
From<&[T]> for Box<[T]>bound toT: Clone. - Remove unnecessary
T: Sendbound inError for mpsc::SendError<T>andTrySendError<T>. - Fix docs for
alloc::reallocto matchLayoutrequirements that the size must not exceedisize::MAX. - Document
const {}syntax forstd::thread_local. This syntax was stabilized in Rust 1.59, but not previously mentioned in release notes.
Stabilized APIs
CStr::is_emptyBuildHasher::hash_oneNonZeroI*::is_positiveNonZeroI*::is_negativeNonZeroI*::checked_negNonZeroI*::overflowing_negNonZeroI*::saturating_negNonZeroI*::wrapping_negNeg for NonZeroI*Neg for &NonZeroI*From<[T; N]> for (T...)(array to N-tuple for N in 1..=12)From<(T...)> for [T; N](N-tuple to array for N in 1..=12)windows::io::AsHandle for Box<T>windows::io::AsHandle for Rc<T>windows::io::AsHandle for Arc<T>windows::io::AsSocket for Box<T>windows::io::AsSocket for Rc<T>windows::io::AsSocket for Arc<T>
These APIs are now stable in const contexts:
<*const T>::read<*const T>::read_unaligned<*mut T>::read<*mut T>::read_unalignedptr::readptr::read_unaligned<[T]>::split_at
Cargo
- Allow named debuginfo options in
Cargo.toml. - Add
workspace_default_membersto the output ofcargo metadata. - Automatically inherit workspace fields when running
cargo new/cargo init.
Rustdoc
- Add a new
rustdoc::unescaped_backtickslint for broken inline code. - Support strikethrough with single tildes. (
~~old~~vs.~new~)
Misc
Compatibility Notes
- Remove structural match from
TypeId. Code that uses a constantTypeIdin a pattern will potentially be broken. Known cases have already been fixed -- in particular, users of thelogcrate'skv_unstablefeature should update tolog v0.4.18or later. - Add a
sysrootcrate to represent the standard library crates. This does not affect stable users, but may require adjustment in tools that build their own standard library. - Cargo optimizes its usage under
rustup. When Cargo detects it will runrustcpointing to a rustup proxy, it'll try bypassing the proxy and use the underlying binary directly. There are assumptions around the interaction with rustup andRUSTUP_TOOLCHAIN. However, it's not expected to affect normal users. - When querying a package, Cargo tries only the original name, all hyphens, and all underscores to handle misspellings. Previously, Cargo tried each combination of hyphens and underscores, causing excessive requests to crates.io.
- Cargo now disallows
RUSTUP_HOMEandRUSTUP_TOOLCHAINin the[env]configuration table. This is considered to be not a use case Cargo would like to support, since it will likely cause problems or lead to confusion.
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.
Rust 1.70.0
Language
- Relax ordering rules for
asm!operands - Properly allow macro expanded
format_argsinvocations to uses captures - Lint ambiguous glob re-exports
- Perform const and unsafe checking for expressions in
let _ = exprposition.
Compiler
- Extend -Cdebuginfo with new options and named aliases This provides a smaller version of debuginfo for cases that only need line number information (
-Cdebuginfo=line-tables-only), which may eventually become the default for-Cdebuginfo=1. - Make
unused_allocationlint againstBox::newtoo - Detect uninhabited types early in const eval
- Switch to LLD as default linker for {arm,thumb}v4t-none-eabi
- Add tier 3 target
loongarch64-unknown-linux-gnu - Add tier 3 target for
i586-pc-nto-qnx700(QNX Neutrino RTOS, version 7.0), - Insert alignment checks for pointer dereferences as debug assertions This catches undefined behavior at runtime, and may cause existing code to fail.
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Document NonZeroXxx layout guarantees
- Windows: make
Commandprefer non-verbatim paths - Implement Default for some alloc/core iterators
- Fix handling of trailing bare CR in str::lines
- allow negative numeric literals in
concat! - Add documentation about the memory layout of
Cell - Use
partial_cmpto implement tuplelt/le/ge/gt - Stabilize
atomic_as_ptr - Stabilize
nonnull_slice_from_raw_parts - Partial stabilization of
once_cell - Stabilize
nonzero_min_max - Flatten/inline format_args!() and (string and int) literal arguments into format_args!()
- Stabilize movbe target feature
- don't splice from files into pipes in io::copy
- Add a builtin unstable
FnPtrtrait that is implemented for all function pointers This extendsDebug,Pointer,Hash,PartialEq,Eq,PartialOrd, andOrdimplementations for function pointers with all ABIs.
Stabilized APIs
NonZero*::MIN/MAXBinaryHeap::retainDefault for std::collections::binary_heap::IntoIterDefault for std::collections::btree_map::{IntoIter, Iter, IterMut}Default for std::collections::btree_map::{IntoKeys, Keys}Default for std::collections::btree_map::{IntoValues, Values}Default for std::collections::btree_map::RangeDefault for std::collections::btree_set::{IntoIter, Iter}Default for std::collections::btree_set::RangeDefault for std::collections::linked_list::{IntoIter, Iter, IterMut}Default for std::vec::IntoIterDefault for std::iter::ChainDefault for std::iter::ClonedDefault for std::iter::CopiedDefault for std::iter::EnumerateDefault for std::iter::FlattenDefault for std::iter::FuseDefault for std::iter::RevDefault for std::slice::IterDefault for std::slice::IterMutRc::into_innerArc::into_innerstd::cell::OnceCellOption::is_some_andNonNull::slice_from_raw_partsResult::is_ok_andResult::is_err_andstd::sync::atomic::Atomic*::as_ptrstd::io::IsTerminalstd::os::linux::net::SocketAddrExtstd::os::unix::net::UnixDatagram::bind_addrstd::os::unix::net::UnixDatagram::connect_addrstd::os::unix::net::UnixDatagram::send_to_addrstd::os::unix::net::UnixListener::bind_addrstd::path::Path::as_mut_os_strstd::sync::OnceLock
Cargo
- Add
CARGO_PKG_README - Make
sparsethe default protocol for crates.io - Accurately show status when downgrading dependencies
- Use registry.default for login/logout
- Stabilize
cargo logout
Misc
Compatibility Notes
- Prevent stable
libtestfrom supporting-Zunstable-options - Perform const and unsafe checking for expressions in
let _ = exprposition. - WebAssembly targets enable
sign-extandmutable-globalsfeatures in codegen This may cause incompatibility with older execution environments. - Insert alignment checks for pointer dereferences as debug assertions This catches undefined behavior at runtime, and may cause existing code to fail.
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.
Rust 1.69.0
Language
- Deriving built-in traits on packed structs works with
Copyfields. - Stabilize the
cmpxchg16btarget feature on x86 and x86_64. - Improve analysis of trait bounds for associated types.
- Allow associated types to be used as union fields.
- Allow
Self: Autotraitbounds on dyn-safe trait methods. - Treat
stras containing[u8]for auto trait purposes.
Compiler
- Upgrade
*-pc-windows-gnuon CI to mingw-w64 v10 and GCC 12.2. - Rework min_choice algorithm of member constraints.
- Support
trueandfalseas boolean flags in compiler arguments. - Default
repr(C)enums toc_intsize.
Libraries
- Implement the unstable
DispatchFromDynfor cell types, allowing downstream experimentation with custom method receivers. - Document that
fmt::Arguments::as_str()may returnSome(_)in more cases after optimization, subject to change. - Implement
AsFdandAsRawFdforRc.
Stabilized APIs
These APIs are now stable in const contexts:
SocketAddr::newSocketAddr::ipSocketAddr::portSocketAddr::is_ipv4SocketAddr::is_ipv6SocketAddrV4::newSocketAddrV4::ipSocketAddrV4::portSocketAddrV6::newSocketAddrV6::ipSocketAddrV6::portSocketAddrV6::flowinfoSocketAddrV6::scope_id
Cargo
- Cargo now suggests
cargo fixorcargo clippy --fixwhen compilation warnings are auto-fixable. - Cargo now suggests
cargo addif you try to install a library crate. - Cargo now sets the
CARGO_BIN_NAMEenvironment variable also for binary examples.
Rustdoc
- Vertically compact trait bound formatting.
- Only include stable lints in
rustdoc::allgroup. - Compute maximum Levenshtein distance based on the query.
- Remove inconsistently-present sidebar tooltips.
- Search by macro when query ends with
!.
Compatibility Notes
- The
rust-analysiscomponent fromrustupnow only contains a warning placeholder. This was primarily intended for RLS, and the corresponding-Zsave-analysisflag has been removed from the compiler as well. - Unaligned references to packed fields are now a hard error. This has been a warning since 1.53, and denied by default with a future-compatibility warning since 1.62.
- Update the minimum external LLVM to 14.
- Cargo now emits errors on invalid characters in a registry token.
- When
default-featuresis set to false of a workspace dependency, and an inherited dependency of a member hasdefault-features = true, Cargo will enable default features of that dependency. - Cargo denies
CARGO_HOMEin the[env]configuration table. Cargo itself doesn't pick up this value, but recursive calls to cargo would, which was not intended. - Debuginfo for build dependencies is now off if not explicitly set. This is expected to improve the overall build time.
- The Rust distribution no longer always includes rustdoc If
tools = [...]is set in bootstrap.toml, we will respect a missing rustdoc in that list. By default rustdoc remains included. To retain the prior behavior explicitly add"rustdoc"to the list.
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.
Rust 1.68.2
- 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
Rust 1.68.1
- 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
Rust 1.68.0
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
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
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
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:
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
Misc
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
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