Update dependency rust to v1.89.0 - autoclosed
This MR contains the following updates:
Package | Update | Change |
---|---|---|
rust | minor |
1.73.0 -> 1.89.0
|
MR created with the help of gitlab-org/frontend/renovate-gitlab-bot
Release Notes
rust-lang/rust (rust)
v1.89.0
==========================
Language
- Stabilize explicitly inferred const arguments (
feature(generic_arg_infer)
) -
Add a warn-by-default
mismatched_lifetime_syntaxes
lint. This lint detects when the same lifetime is referred to by different syntax categories between function arguments and return values, which can be confusing to read, especially in unsafe code. This lint supersedes the warn-by-defaultelided_named_lifetimes
lint. - Expand
unpredictable_function_pointer_comparisons
to also lint on function pointer comparisons in external macros - Make the
dangerous_implicit_autorefs
lint deny-by-default - Stabilize the avx512 target features
- Stabilize
kl
andwidekl
target features for x86 - Stabilize
sha512
,sm3
andsm4
target features for x86 - Stabilize LoongArch target features
f
,d
,frecipe
,lasx
,lbt
,lsx
, andlvz
- Remove
i128
andu128
fromimproper_ctypes_definitions
- Stabilize
repr128
(#[repr(u128)]
,#[repr(i128)]
) - Allow
#![doc(test(attr(..)))]
everywhere - Extend temporary lifetime extension to also go through tuple struct and tuple variant constructors
extern "C"
functions on thewasm32-unknown-unknown
target now have a standards compliant ABI
Compiler
- Default to non-leaf frame pointers on aarch64-linux
- Enable non-leaf frame pointers for Arm64EC Windows
- Set Apple frame pointers by architecture
Platform Support
- Add new Tier-3 targets
loongarch32-unknown-none
andloongarch32-unknown-none-softfloat
x86_64-apple-darwin
is in the process of being demoted to Tier 2 with host tools
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Specify the base path for
file!
- Allow storing
format_args!()
in a variable - Add
#[must_use]
to[T; N]::map
- Implement
DerefMut
forLazy{Cell,Lock}
- Implement
Default
forarray::IntoIter
- Implement
Clone
forslice::ChunkBy
- Implement
io::Seek
forio::Take
Stabilized APIs
NonZero<char>
- Many intrinsics for x86, not enumerated here
File::lock
File::lock_shared
File::try_lock
File::try_lock_shared
File::unlock
NonNull::from_ref
NonNull::from_mut
NonNull::without_provenance
NonNull::with_exposed_provenance
NonNull::expose_provenance
OsString::leak
PathBuf::leak
Result::flatten
std::os::linux::net::TcpStreamExt::quickack
std::os::linux::net::TcpStreamExt::set_quickack
These previously stable APIs are now stable in const contexts:
Cargo
-
cargo fix
andcargo clippy --fix
now default to the same Cargo target selection as other build commands. Previously it would apply to all targets (like binaries, examples, tests, etc.). The--edition
flag still applies to all targets. -
Stabilize doctest-xcompile. Doctests are now tested when cross-compiling. Just like other tests, it will use the
runner
setting to run the tests. If you need to disable tests for a target, you can use the ignore doctest attribute to specify the targets to ignore.
Rustdoc
- On mobile, make the sidebar full width and linewrap. This makes long section and item names much easier to deal with on mobile.
Compatibility Notes
- Make
missing_fragment_specifier
an unconditional error -
Enabling the
neon
target feature onaarch64-unknown-none-softfloat
causes a warning because mixing code with and without that target feature is not properly supported by LLVM -
Sized Hierarchy: Part I
- Introduces a small breaking change affecting
?Sized
bounds on impls on recursive types which contain associated type projections. It is not expected to affect any existing published crates. Can be fixed by refactoring the involved types or opting into thesized_hierarchy
unstable feature. See the FCP report for a code example.
- Introduces a small breaking change affecting
- The warn-by-default
elided_named_lifetimes
lint is superseded by the warn-by-defaultmismatched_lifetime_syntaxes
lint. - Error on recursive opaque types earlier in the type checker
- Type inference side effects from requiring element types of array repeat expressions are
Copy
are now only available at the end of type checking -
The deprecated accidentally-stable
std::intrinsics::{copy,copy_nonoverlapping,write_bytes}
are now proper intrinsics. There are no debug assertions guarding against UB, and they cannot be coerced to function pointers. - Remove long-deprecated
std::intrinsics::drop_in_place
- Make well-formedness predicates no longer coinductive
- Remove hack when checking impl method compatibility
- Remove unnecessary type inference due to built-in trait object impls
- Lint against "stdcall", "fastcall", and "cdecl" on non-x86-32 targets
- Future incompatibility warnings relating to the never type (
!
) are now reported in dependencies - Ensure
std::ptr::copy_*
intrinsics also perform the static self-init checks extern "C"
functions on thewasm32-unknown-unknown
target now have a standards compliant ABI
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.
v1.88.0
==========================
Language
-
Stabilize
#![feature(let_chains)]
in the 2024 edition. This feature allows&&
-chaininglet
statements insideif
andwhile
, allowing intermixture with boolean expressions. The patterns inside thelet
sub-expressions can be irrefutable or refutable. -
Stabilize
#![feature(naked_functions)]
. Naked functions allow writing functions with no compiler-generated epilogue and prologue, allowing full control over the generated assembly for a particular function. -
Stabilize
#![feature(cfg_boolean_literals)]
. This allows using boolean literals ascfg
predicates, e.g.#[cfg(true)]
and#[cfg(false)]
. -
Fully de-stabilize the
#[bench]
attribute. Usage of#[bench]
without#![feature(custom_test_frameworks)]
already triggered a deny-by-default future-incompatibility lint since Rust 1.77, but will now become a hard error. -
Add warn-by-default
dangerous_implicit_autorefs
lint against implicit autoref of raw pointer dereference. The lint will be bumped to deny-by-default in the next version of Rust. -
Add
invalid_null_arguments
lint to prevent invalid usage of null pointers. This lint is uplifted fromclippy::invalid_null_ptr_usage
. - Change trait impl candidate preference for builtin impls and trivial where-clauses.
- Check types of generic const parameter defaults
Compiler
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Remove backticks from
#[should_panic]
test failure message. -
Guarantee that
[T; N]::from_fn
is generated in order of increasing indices., for those passing it a stateful closure. - The libtest flag
--nocapture
is deprecated in favor of the more consistent--no-capture
flag. - Guarantee that
{float}::NAN
is a quiet NaN.
Stabilized APIs
Cell::update
impl Default for *const T
impl Default for *mut T
HashMap::extract_if
HashSet::extract_if
hint::select_unpredictable
proc_macro::Span::line
proc_macro::Span::column
proc_macro::Span::start
proc_macro::Span::end
proc_macro::Span::file
proc_macro::Span::local_file
<[T]>::as_chunks
<[T]>::as_chunks_mut
<[T]>::as_chunks_unchecked
<[T]>::as_chunks_unchecked_mut
<[T]>::as_rchunks
<[T]>::as_rchunks_mut
mod ffi::c_str
These previously stable APIs are now stable in const contexts:
NonNull<T>::replace
<*mut T>::replace
std::ptr::swap_nonoverlapping
Cell::replace
Cell::get
Cell::get_mut
Cell::from_mut
Cell::as_slice_of_cells
Cargo
Rustdoc
- Doctests can be ignored based on target names using
ignore-*
attributes. - Stabilize the
--test-runtool
and--test-runtool-arg
CLI options to specify a program (like qemu) and its arguments to run a doctest.
Compatibility Notes
-
Finish changing the internal representation of pasted tokens. Certain invalid declarative macros that were previously accepted in obscure circumstances are now correctly rejected by the compiler. Use of a
tt
fragment specifier can often fix these macros. -
Fully de-stabilize the
#[bench]
attribute. Usage of#[bench]
without#![feature(custom_test_frameworks)]
already triggered a deny-by-default future-incompatibility lint since Rust 1.77, but will now become a hard error. - Fix borrow checking some always-true patterns. The borrow checker was overly permissive in some cases, allowing programs that shouldn't have compiled.
- Update the minimum external LLVM to 19.
- Make it a hard error to use a vector type with a non-Rust ABI without enabling the required target feature.
v1.87.0
==========================
Language
- Stabilize
asm_goto
feature -
Allow parsing open beginning ranges (
..EXPR
) after unary operators!
,-
, and*
. - Don't require method impls for methods with
Self: Sized
bounds inimpl
s for unsized types - Stabilize
feature(precise_capturing_in_traits)
allowinguse<...>
bounds on return positionimpl Trait
intrait
s
Compiler
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Stabilize the anonymous pipe API
- Add support for unbounded left/right shift operations
- Print pointer metadata in
Debug
impl of raw pointers Vec::with_capacity
guarantees it allocates with the amount requested, even ifVec::capacity
returns a different number.- Most
std::arch
intrinsics which don't take pointer arguments can now be called from safe code if the caller has the appropriate target features already enabled (https://github.com/rust-lang/stdarch/pull/1714, https://github.com/rust-lang/stdarch/pull/1716, https://github.com/rust-lang/stdarch/pull/1717) - Undeprecate
env::home_dir
- Denote
ControlFlow
as#[must_use]
- Macros such as
assert_eq!
andvec!
now supportconst {...}
expressions
Stabilized APIs
Vec::extract_if
vec::ExtractIf
LinkedList::extract_if
linked_list::ExtractIf
<[T]>::split_off
<[T]>::split_off_mut
<[T]>::split_off_first
<[T]>::split_off_first_mut
<[T]>::split_off_last
<[T]>::split_off_last_mut
String::extend_from_within
os_str::Display
OsString::display
OsStr::display
io::pipe
io::PipeReader
io::PipeWriter
impl From<PipeReader> for OwnedHandle
impl From<PipeWriter> for OwnedHandle
impl From<PipeReader> for Stdio
impl From<PipeWriter> for Stdio
impl From<PipeReader> for OwnedFd
impl From<PipeWriter> for OwnedFd
Box<MaybeUninit<T>>::write
impl TryFrom<Vec<u8>> for String
<*const T>::offset_from_unsigned
<*const T>::byte_offset_from_unsigned
<*mut T>::offset_from_unsigned
<*mut T>::byte_offset_from_unsigned
NonNull::offset_from_unsigned
NonNull::byte_offset_from_unsigned
<uN>::cast_signed
-
NonZero::<uN>::cast_signed
. -
<iN>::cast_unsigned
. -
NonZero::<iN>::cast_unsigned
. <uN>::is_multiple_of
<uN>::unbounded_shl
<uN>::unbounded_shr
<iN>::unbounded_shl
<iN>::unbounded_shr
<iN>::midpoint
<str>::from_utf8
<str>::from_utf8_mut
<str>::from_utf8_unchecked
<str>::from_utf8_unchecked_mut
These previously stable APIs are now stable in const contexts:
core::str::from_utf8_mut
<[T]>::copy_from_slice
SocketAddr::set_ip
-
SocketAddr::set_port
, SocketAddrV4::set_ip
-
SocketAddrV4::set_port
, SocketAddrV6::set_ip
SocketAddrV6::set_port
SocketAddrV6::set_flowinfo
SocketAddrV6::set_scope_id
char::is_digit
char::is_whitespace
<[[T; N]]>::as_flattened
<[[T; N]]>::as_flattened_mut
String::into_bytes
String::as_str
String::capacity
String::as_bytes
String::len
String::is_empty
String::as_mut_str
String::as_mut_vec
Vec::as_ptr
Vec::as_slice
Vec::capacity
Vec::len
Vec::is_empty
Vec::as_mut_slice
Vec::as_mut_ptr
Cargo
- Add terminal integration via ANSI OSC 9;4 sequences
- chore: bump openssl to v3
- feat(package): add --exclude-lockfile flag
Compatibility Notes
- Rust now raises an error for macro invocations inside the
#![crate_name]
attribute - Unstable fields are now always considered to be inhabited
- Macro arguments of unary operators followed by open beginning ranges may now be matched differently
- Make
Debug
impl of raw pointers print metadata if present - Warn against function pointers using unsupported ABI strings in dependencies
- Associated types on
dyn
types are no longer deduplicated - Forbid attributes on
..
inside of struct patterns (let Struct { #[attribute] .. }) =
- Make
ptr_cast_add_auto_to_object
lint into hard error - Many
std::arch
intrinsics are now safe to call in some contexts, there may now be newunused_unsafe
warnings in existing codebases. - Limit
width
andprecision
formatting options to 16 bits on all targets - Turn order dependent trait objects future incompat warning into a hard error
- Denote
ControlFlow
as#[must_use]
-
Windows: The standard library no longer links
advapi32
, except on win7. Code such as C libraries that were relying on this assumption may need to explicitly link advapi32. - Proc macros can no longer observe expanded
cfg(true)
attributes. -
Start changing the internal representation of pasted tokens. Certain invalid declarative macros that were previously accepted in obscure circumstances are now correctly rejected by the compiler. Use of a
tt
fragment specifier can often fix these macros. - Don't allow flattened format_args in const.
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.
v1.86.0
==========================
Language
- Stabilize upcasting trait objects to supertraits.
- Allow safe functions to be marked with the
#[target_feature]
attribute. - The
missing_abi
lint now warns-by-default. - Rust now lints about double negations, to catch cases that might have intended to be a prefix decrement operator (
--x
) as written in other languages. This was previously a clippy lint,clippy::double_neg
, and is now available directly in Rust asdouble_negations
. - More pointers are now detected as definitely not-null based on their alignment in const eval.
- Empty
repr()
attribute applied to invalid items are now correctly rejected. - Inner attributes
#![test]
and#![rustfmt::skip]
are no longer accepted in more places than intended.
Compiler
- Debug-assert that raw pointers are non-null on access.
- Change
-O
to mean-C opt-level=3
instead of-C opt-level=2
to match Cargo's defaults. - Fix emission of
overflowing_literals
under certain macro environments.
Platform Support
- Replace
i686-unknown-redox
target withi586-unknown-redox
. - Increase baseline CPU of
i686-unknown-hurd-gnu
to Pentium 4. - New tier 3 targets:
-
{aarch64-unknown,x86_64-pc}-nto-qnx710_iosock
. For supporting Neutrino QNX 7.1 withio-socket
network stack. -
{aarch64-unknown,x86_64-pc}-nto-qnx800
. For supporting Neutrino QNX 8.0 (no_std
-only). -
{x86_64,i686}-win7-windows-gnu
. Intended for backwards compatibility with Windows 7.{x86_64,i686}-win7-windows-msvc
are the Windows MSVC counterparts that already exist as Tier 3 targets. -
amdgcn-amd-amdhsa
. -
x86_64-pc-cygwin
. -
{mips,mipsel}-mti-none-elf
. Initial bare-metal support. -
m68k-unknown-none-elf
. -
armv7a-nuttx-{eabi,eabihf}
,aarch64-unknown-nuttx
, andthumbv7a-nuttx-{eabi,eabihf}
.
-
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- The type of
FromBytesWithNulError
inCStr::from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>
was changed from an opaque struct to an enum, allowing users to examine why the conversion failed. - Remove
RustcDecodable
andRustcEncodable
. - Deprecate libtest's
--logfile
option. - On recent versions of Windows,
std::fs::remove_file
will now remove read-only files.
Stabilized APIs
{float}::next_down
{float}::next_up
<[_]>::get_disjoint_mut
<[_]>::get_disjoint_unchecked_mut
slice::GetDisjointMutError
HashMap::get_disjoint_mut
HashMap::get_disjoint_unchecked_mut
NonZero::count_ones
Vec::pop_if
sync::Once::wait
sync::Once::wait_force
sync::OnceLock::wait
These APIs are now stable in const contexts:
hint::black_box
io::Cursor::get_mut
io::Cursor::set_position
str::is_char_boundary
str::split_at
str::split_at_checked
str::split_at_mut
str::split_at_mut_checked
Cargo
- When merging, replace rather than combine configuration keys that refer to a program path and its arguments.
-
Error if both
--package
and--workspace
are passed but the requested package is missing. This was previously silently ignored, which was considered a bug since missing packages should be reported. - Deprecate the token argument in
cargo login
to avoid shell history leaks. -
Simplify the implementation of
SourceID
comparisons. This may potentially change behavior if the canonicalized URL compares differently in alternative registries.
Rustdoc
Compatibility Notes
-
The
wasm_c_abi
future compatibility warning is now a hard error. Users ofwasm-bindgen
should upgrade to at least version 0.2.89, otherwise compilation will fail. - Remove long-deprecated no-op attributes
#![no_start]
and#![crate_id]
. -
The future incompatibility lint
cenum_impl_drop_cast
has been made into a hard error. This means it is now an error to cast a field-less enum to an integer if the enum implementsDrop
. - SSE2 is now required for "i686" 32-bit x86 hard-float targets; disabling it causes a warning that will become a hard error eventually. To compile for pre-SSE2 32-bit x86, use a "i586" target instead.
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.
- Build the rustc on AArch64 Linux with ThinLTO + PGO. The ARM 64-bit compiler (AArch64) on Linux is now optimized with ThinLTO and PGO, similar to the optimizations we have already performed for the x86-64 compiler on Linux. This should make it up to 30% faster.
v1.85.1
==========================
- Fix the doctest-merging feature of the 2024 Edition.
- Relax some
target_feature
checks when generating docs. - Fix errors in
std::fs::rename
on Windows 10, version 1607. - Downgrade bootstrap
cc
to fix custom targets. - Skip submodule updates when building Rust from a source tarball.
v1.85.0
==========================
Language
- The 2024 Edition is now stable. See the edition guide for more details.
- Stabilize async closures See RFC 3668 for more details.
- Stabilize
#[diagnostic::do_not_recommend]
- Add
unpredictable_function_pointer_comparisons
lint to warn against function pointer comparisons - Lint on combining
#[no_mangle]
and#[export_name]
attributes.
Compiler
-
The unstable flag
-Zpolymorphize
has been removed, see https://github.com/rust-lang/compiler-team/issues/810 for some background.
Platform Support
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
-
Panics in the standard library now have a leading
library/
in their path -
std::env::home_dir()
on Windows now ignores the non-standard$HOME
environment variableIt will be un-deprecated in a subsequent release.
Stabilized APIs
BuildHasherDefault::new
ptr::fn_addr_eq
io::ErrorKind::QuotaExceeded
io::ErrorKind::CrossesDevices
{float}::midpoint
- Unsigned
{integer}::midpoint
NonZeroU*::midpoint
- impl
std::iter::Extend
for tuples with arity 1 through 12 FromIterator<(A, ...)>
for tuples with arity 1 through 12std::task::Waker::noop
These APIs are now stable in const contexts:
mem::size_of_val
mem::align_of_val
Layout::for_value
Layout::align_to
Layout::pad_to_align
Layout::extend
Layout::array
std::mem::swap
std::ptr::swap
NonNull::new
HashMap::with_hasher
HashSet::with_hasher
BuildHasherDefault::new
<float>::recip
<float>::to_degrees
<float>::to_radians
<float>::max
<float>::min
<float>::clamp
<float>::abs
<float>::signum
<float>::copysign
MaybeUninit::write
Cargo
- Add future-incompatibility warning against keywords in cfgs and add raw-idents
- Stabilize higher precedence trailing flags
- Pass
CARGO_CFG_FEATURE
to build scripts
Rustdoc
Compatibility Notes
-
rustc
no longer treats thetest
cfg as a well known check-cfg, instead it is up to the build systems and users of--check-cfg
[^check-cfg] to set it as a well known cfg using--check-cfg=cfg(test)
.This is done to enable build systems like Cargo to set it conditionally, as not all source files are suitable for unit tests. Cargo (for now) unconditionally sets the
test
cfg as a well known cfg. [^check-cfg]: https://doc.rust-lang.org/nightly/rustc/check-cfg.html -
Disable potentially incorrect type inference if there are trivial and non-trivial where-clauses
-
std::env::home_dir()
has been deprecated for years, because it can give surprising results in some Windows configurations if theHOME
environment variable is set (which is not the normal configuration on Windows). We had previously avoided changing its behavior, out of concern for compatibility with code depending on this non-standard configuration. Given how long this function has been deprecated, we're now fixing its behavior as a bugfix. A subsequent release will remove the deprecation for this function. -
Make
core::ffi::c_char
signedness more closely match that of the platform-defaultchar
This changed
c_char
from ani8
tou8
or vice versa on many Tier 2 and 3 targets (mostly Arm and RISC-V embedded targets). The new definition may result in compilation failures but fixes compatibility issues with C.The
libc
crate matches this change as of its 0.2.169 release. -
Increase
sparcv9-sun-solaris
andx86_64-pc-solaris
Solaris baseline to 11.4. -
Show
abi_unsupported_vector_types
lint in future breakage reports
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.
v1.84.1
==========================
- Fix ICE 132920 in duplicate-crate diagnostics.
- Fix errors for overlapping impls in incremental rebuilds.
- Fix slow compilation related to the next-generation trait solver.
- Fix debuginfo when LLVM's location discriminator value limit is exceeded.
- Fixes for building Rust from source:
v1.84.0
==========================
Language
- Allow
#[deny]
inside#[forbid]
as a no-op - Show a warning when
-Ctarget-feature
is used to toggle features that can lead to unsoundness due to ABI mismatches - Use the next-generation trait solver in coherence
- Allow coercions to drop the principal of trait objects
- Support
/
as the path separator forinclude!()
in all cases on Windows - Taking a raw ref (
raw (const|mut)
) of a deref of a pointer (*ptr
) is now safe - Stabilize s390x inline assembly
- Stabilize Arm64EC inline assembly
- Lint against creating pointers to immediately dropped temporaries
- Execute drop glue when unwinding in an
extern "C"
function
Compiler
- Add
--print host-tuple
flag to print the host target tuple and affirm the "target tuple" terminology over "target triple" - Declaring functions with a calling convention not supported on the current target now triggers a hard error
- Set up indirect access to external data for
loongarch64-unknown-linux-{musl,ohos}
- Enable XRay instrumentation for LoongArch Linux targets
- Extend the
unexpected_cfgs
lint to also warn in external macros - Stabilize WebAssembly
multivalue
,reference-types
, andtail-call
target features - Added Tier 2 support for the
wasm32v1-none
target
Libraries
- Implement
From<&mut {slice}>
forBox/Rc/Arc<{slice}>
- Move
<float>::copysign
,<float>::abs
,<float>::signum
tocore
- Add
LowerExp
andUpperExp
implementations toNonZero
- Implement
FromStr
forCString
andTryFrom<CString>
forString
std::os::darwin
has been made public
Stabilized APIs
Ipv6Addr::is_unique_local
Ipv6Addr::is_unicast_link_local
core::ptr::with_exposed_provenance
core::ptr::with_exposed_provenance_mut
<ptr>::addr
<ptr>::expose_provenance
<ptr>::with_addr
<ptr>::map_addr
<int>::isqrt
<int>::checked_isqrt
<uint>::isqrt
NonZero::isqrt
core::ptr::without_provenance
core::ptr::without_provenance_mut
core::ptr::dangling
core::ptr::dangling_mut
Pin::as_deref_mut
These APIs are now stable in const contexts
AtomicBool::from_ptr
AtomicPtr::from_ptr
AtomicU8::from_ptr
AtomicU16::from_ptr
AtomicU32::from_ptr
AtomicU64::from_ptr
AtomicUsize::from_ptr
AtomicI8::from_ptr
AtomicI16::from_ptr
AtomicI32::from_ptr
AtomicI64::from_ptr
AtomicIsize::from_ptr
<ptr>::is_null
<ptr>::as_ref
<ptr>::as_mut
Pin::new
Pin::new_unchecked
Pin::get_ref
Pin::into_ref
Pin::get_mut
Pin::get_unchecked_mut
Pin::static_ref
Pin::static_mut
Cargo
Rustdoc
Compatibility Notes
- Enable by default the
LSX
target feature for LoongArch Linux targets -
The unstable
-Zprofile
flag (“gcov-style” coverage instrumentation) has been removed. This does not affect the stable flags for coverage instrumentation (-Cinstrument-coverage
) and profile-guided optimization (-Cprofile-generate
,-Cprofile-use
), which are unrelated and remain available. - Support for the target named
wasm32-wasi
has been removed as the target is now namedwasm32-wasip1
. This completes the transition plan for this target following the introduction ofwasm32-wasip1
in Rust 1.78. Compiler warnings on use ofwasm32-wasi
introduced in Rust 1.81 are now gone as well as the target is removed. - The syntax
&pin (mut|const) T
is now parsed as a type which in theory could affect macro expansion results in some edge cases - Legacy syntax for calling
std::arch
functions is no longer permitted to declare items or bodies (such as closures, inline consts, or async blocks). - Declaring functions with a calling convention not supported on the current target now triggers a hard error
- The next-generation trait solver is now enabled for coherence, fixing multiple soundness issues
v1.83.0
==========================
Language
- Stabilize
&mut
,*mut
,&Cell
, and*const Cell
in const. - Allow creating references to statics in
const
initializers. - Implement raw lifetimes and labels (
'r#ident
). - Define behavior when atomic and non-atomic reads race.
- Non-exhaustive structs may now be empty.
- Disallow implicit coercions from places of type
!
const extern
functions can now be defined for other calling conventions.- Stabilize
expr_2021
macro fragment specifier in all editions. - The
non_local_definitions
lint now fires on less code and warns by default.
Compiler
- Deprecate unsound
-Csoft-float
flag. - Add many new tier 3 targets:
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- Implement
PartialEq
forExitCode
. - Document that
catch_unwind
can deal with foreign exceptions without UB, although the exact behavior is unspecified. - Implement
Default
forHashMap
/HashSet
iterators that don't already have it. - Bump Unicode to version 16.0.0.
- Change documentation of
ptr::add
/sub
to not claim equivalence withoffset
.
Stabilized APIs
BufRead::skip_until
ControlFlow::break_value
ControlFlow::continue_value
ControlFlow::map_break
ControlFlow::map_continue
DebugList::finish_non_exhaustive
DebugMap::finish_non_exhaustive
DebugSet::finish_non_exhaustive
DebugTuple::finish_non_exhaustive
ErrorKind::ArgumentListTooLong
ErrorKind::Deadlock
ErrorKind::DirectoryNotEmpty
ErrorKind::ExecutableFileBusy
ErrorKind::FileTooLarge
ErrorKind::HostUnreachable
ErrorKind::IsADirectory
ErrorKind::NetworkDown
ErrorKind::NetworkUnreachable
ErrorKind::NotADirectory
ErrorKind::NotSeekable
ErrorKind::ReadOnlyFilesystem
ErrorKind::ResourceBusy
ErrorKind::StaleNetworkFileHandle
ErrorKind::StorageFull
ErrorKind::TooManyLinks
Option::get_or_insert_default
Waker::data
Waker::new
Waker::vtable
char::MIN
hash_map::Entry::insert_entry
hash_map::VacantEntry::insert_entry
These APIs are now stable in const contexts:
Cell::into_inner
Duration::as_secs_f32
Duration::as_secs_f64
Duration::div_duration_f32
Duration::div_duration_f64
MaybeUninit::as_mut_ptr
NonNull::as_mut
NonNull::copy_from
NonNull::copy_from_nonoverlapping
NonNull::copy_to
NonNull::copy_to_nonoverlapping
NonNull::slice_from_raw_parts
NonNull::write
NonNull::write_bytes
NonNull::write_unaligned
OnceCell::into_inner
Option::as_mut
Option::expect
Option::replace
Option::take
Option::unwrap
Option::unwrap_unchecked
Option::<&_>::copied
Option::<&mut _>::copied
Option::<Option<_>>::flatten
Option::<Result<_, _>>::transpose
RefCell::into_inner
Result::as_mut
Result::<&_, _>::copied
Result::<&mut _, _>::copied
Result::<Option<_>, _>::transpose
UnsafeCell::get_mut
UnsafeCell::into_inner
array::from_mut
char::encode_utf8
{float}::classify
{float}::is_finite
{float}::is_infinite
{float}::is_nan
{float}::is_normal
{float}::is_sign_negative
{float}::is_sign_positive
{float}::is_subnormal
{float}::from_bits
{float}::from_be_bytes
{float}::from_le_bytes
{float}::from_ne_bytes
{float}::to_bits
{float}::to_be_bytes
{float}::to_le_bytes
{float}::to_ne_bytes
mem::replace
ptr::replace
ptr::slice_from_raw_parts_mut
ptr::write
ptr::write_unaligned
<*const _>::copy_to
<*const _>::copy_to_nonoverlapping
<*mut _>::copy_from
<*mut _>::copy_from_nonoverlapping
<*mut _>::copy_to
<*mut _>::copy_to_nonoverlapping
<*mut _>::write
<*mut _>::write_bytes
<*mut _>::write_unaligned
slice::from_mut
slice::from_raw_parts_mut
<[_]>::first_mut
<[_]>::last_mut
<[_]>::first_chunk_mut
<[_]>::last_chunk_mut
<[_]>::split_at_mut
<[_]>::split_at_mut_checked
<[_]>::split_at_mut_unchecked
<[_]>::split_first_mut
<[_]>::split_last_mut
<[_]>::split_first_chunk_mut
<[_]>::split_last_chunk_mut
str::as_bytes_mut
str::as_mut_ptr
str::from_utf8_unchecked_mut
Cargo
- Introduced a new
CARGO_MANIFEST_PATH
environment variable, similar toCARGO_MANIFEST_DIR
but pointing directly to the manifest file. - Added
package.autolib
to the manifest, allowing[lib]
auto-discovery to be disabled. - Declare support level for each crate in Cargo's Charter / crate docs.
- Declare new Intentional Artifacts as 'small' changes.
Rustdoc
-
The sidebar / hamburger menu table of contents now includes the
# headers
from the main item's doc comment. This is similar to a third-party feature provided by the rustdoc-search-enhancements browser extension.
Compatibility Notes
-
Warn against function pointers using unsupported ABI strings.
-
Check well-formedness of the source type's signature in fn pointer casts. This partly closes a soundness hole that comes when casting a function item to function pointer
-
Use equality instead of subtyping when resolving type dependent paths.
-
Linking on macOS now correctly includes Rust's default deployment target. Due to a linker bug, you might have to pass
MACOSX_DEPLOYMENT_TARGET
or fix your#[link]
attributes to point to the correct frameworks. See #129369. -
The future incompatibility lint
deprecated_cfg_attr_crate_type_name
has been made into a hard error. It was used to deny usage of#![crate_type]
and#![crate_name]
attributes in#![cfg_attr]
, which required a hack in the compiler to be able to change the used crate type and crate name after cfg expansion. Users can use--crate-type
instead of#![cfg_attr(..., crate_type = "...")]
and--crate-name
instead of#![cfg_attr(..., crate_name = "...")]
when runningrustc
/cargo rustc
on the command line. Use of those two attributes outside of#![cfg_attr]
continue to be fully supported. -
Until now, paths into the sysroot were always prefixed with
/rustc/$hash
in diagnostics, codegen, backtrace, e.g.thread 'main' panicked at 'hello world', map-panic.rs:2:50 stack backtrace: 0: std::panicking::begin_panic at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12 1: map_panic::main::{{closure}} at ./map-panic.rs:2:50 2: core::option::Option<T>::map at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29 3: map_panic::main at ./map-panic.rs:2:30 4: core::ops::function::FnOnce::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
We want to change this behaviour such that, when
rust-src
source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a--remap-path-prefix
that causes this local path to be remapped in the usual way.#129687 implements this behaviour, when
rust-src
is present at compile time,rustc
replaces/rustc/$hash
with a real path into the localrust-src
component with best effort. To sanitize this, users must explicitly supply--remap-path-prefix=<path to rust-src>=foo
or not have therust-src
component installed. -
The allow-by-default
missing_docs
lint used to disable itself when invoked throughrustc --test
/cargo test
, resulting in#[expect(missing_docs)]
emitting false positives due to the expectation being wrongly unfulfilled. This behavior has now been removed, which allows#[expect(missing_docs)]
to be fulfilled in all scenarios, but will also report newmissing_docs
diagnostics for publicly reachable#[cfg(test)]
items, integration test crate-level documentation, and publicly reachable items in integration tests. -
The
armv8r-none-eabihf
target now uses the Armv8-R required set of floating-point features. -
The sysroot no longer contains the
std
dynamic library in its top-levellib/
dir.
v1.82.0
==========================
Language
- Don't make statement nonterminals match pattern nonterminals
- Patterns matching empty types can now be omitted in common cases
- Enforce supertrait outlives obligations when using trait impls
addr_of(_mut)!
macros and the newly stabilized&raw (const|mut)
are now safe to use with all static items- size_of_val_raw: for length 0 this is safe to call
- Reorder trait bound modifiers after
for<...>
binder in trait bounds - Stabilize
+ use<'lt>
opaque type precise capturing (RFC 3617) - Stabilize
&raw const
and&raw mut
operators (RFC 2582) - Stabilize unsafe extern blocks (RFC 3484)
- Stabilize nested field access in
offset_of!
- Do not require
T
to be live when dropping[T; 0]
- Stabilize
const
operands in inline assembly - Stabilize floating-point arithmetic in
const fn
- Stabilize explicit opt-in to unsafe attributes
- Document NaN bit patterns guarantees
Compiler
- Promote riscv64gc-unknown-linux-musl to tier 2
- Promote Mac Catalyst targets
aarch64-apple-ios-macabi
andx86_64-apple-ios-macabi
to Tier 2, and ship them with rustup - Add tier 3 NuttX based targets for RISC-V and ARM
- Add tier 3 powerpc-unknown-linux-muslspe target
- Improved diagnostics to explain why a pattern is unreachable
- The compiler now triggers the unreachable code warning properly for async functions that don't return/are
-> !
- Promote
aarch64-apple-darwin
to Tier 1 - Add Trusty OS target
aarch64-unknown-trusty
andarmv7-unknown-trusty
as tier 3 targets - Promote
wasm32-wasip2
to Tier 2.
Libraries
Stabilized APIs
std::thread::Builder::spawn_unchecked
std::str::CharIndices::offset
std::option::Option::is_none_or
[T]::is_sorted
[T]::is_sorted_by
[T]::is_sorted_by_key
Iterator::is_sorted
Iterator::is_sorted_by
Iterator::is_sorted_by_key
std::future::Ready::into_inner
std::iter::repeat_n
impl<T: Clone> DoubleEndedIterator for Take<Repeat<T>>
impl<T: Clone> ExactSizeIterator for Take<Repeat<T>>
impl<T: Clone> ExactSizeIterator for Take<RepeatWith<T>>
impl Default for std::collections::binary_heap::Iter
impl Default for std::collections::btree_map::RangeMut
impl Default for std::collections::btree_map::ValuesMut
impl Default for std::collections::vec_deque::Iter
impl Default for std::collections::vec_deque::IterMut
Rc<T>::new_uninit
Rc<MaybeUninit<T>>::assume_init
Rc<[T]>::new_uninit_slice
Rc<[MaybeUninit<T>]>::assume_init
Arc<T>::new_uninit
Arc<MaybeUninit<T>>::assume_init
Arc<[T]>::new_uninit_slice
Arc<[MaybeUninit<T>]>::assume_init
Box<T>::new_uninit
Box<MaybeUninit<T>>::assume_init
Box<[T]>::new_uninit_slice
Box<[MaybeUninit<T>]>::assume_init
core::arch::x86_64::_bextri_u64
core::arch::x86_64::_bextri_u32
core::arch::x86::_mm_broadcastsi128_si256
core::arch::x86::_mm256_stream_load_si256
core::arch::x86::_tzcnt_u16
core::arch::x86::_mm_extracti_si64
core::arch::x86::_mm_inserti_si64
core::arch::x86::_mm_storeu_si16
core::arch::x86::_mm_storeu_si32
core::arch::x86::_mm_storeu_si64
core::arch::x86::_mm_loadu_si16
core::arch::x86::_mm_loadu_si32
core::arch::wasm32::u8x16_relaxed_swizzle
core::arch::wasm32::i8x16_relaxed_swizzle
core::arch::wasm32::i32x4_relaxed_trunc_f32x4
core::arch::wasm32::u32x4_relaxed_trunc_f32x4
core::arch::wasm32::i32x4_relaxed_trunc_f64x2_zero
core::arch::wasm32::u32x4_relaxed_trunc_f64x2_zero
core::arch::wasm32::f32x4_relaxed_madd
core::arch::wasm32::f32x4_relaxed_nmadd
core::arch::wasm32::f64x2_relaxed_madd
core::arch::wasm32::f64x2_relaxed_nmadd
core::arch::wasm32::i8x16_relaxed_laneselect
core::arch::wasm32::u8x16_relaxed_laneselect
core::arch::wasm32::i16x8_relaxed_laneselect
core::arch::wasm32::u16x8_relaxed_laneselect
core::arch::wasm32::i32x4_relaxed_laneselect
core::arch::wasm32::u32x4_relaxed_laneselect
core::arch::wasm32::i64x2_relaxed_laneselect
core::arch::wasm32::u64x2_relaxed_laneselect
core::arch::wasm32::f32x4_relaxed_min
core::arch::wasm32::f32x4_relaxed_max
core::arch::wasm32::f64x2_relaxed_min
core::arch::wasm32::f64x2_relaxed_max
core::arch::wasm32::i16x8_relaxed_q15mulr
core::arch::wasm32::u16x8_relaxed_q15mulr
core::arch::wasm32::i16x8_relaxed_dot_i8x16_i7x16
core::arch::wasm32::u16x8_relaxed_dot_i8x16_i7x16
core::arch::wasm32::i32x4_relaxed_dot_i8x16_i7x16_add
core::arch::wasm32::u32x4_relaxed_dot_i8x16_i7x16_add
These APIs are now stable in const contexts:
std::task::Waker::from_raw
std::task::Context::from_waker
std::task::Context::waker
{integer}::from_str_radix
std::num::ParseIntError::kind
Cargo
Compatibility Notes
- We now disallow setting some built-in cfgs via the command-line with the newly added
explicit_builtin_cfgs_in_flags
lint in order to prevent incoherent state, eg.windows
cfg active but target is Linux based. The appropriaterustc
flag should be used instead. - The standard library has a new implementation of
binary_search
which is significantly improves performance (#128254). However when a sorted slice has multiple values which compare equal, the new implementation may select a different value among the equal ones than the old implementation. -
illumos/Solaris now sets
MSG_NOSIGNAL
when writing to sockets. This avoids killing the process with SIGPIPE when writing to a closed socket, which matches the existing behavior on other UNIX targets. - Removes a problematic hack that always passed the --whole-archive linker flag for tests, which may cause linker errors for code accidentally relying on it.
- The WebAssembly target features
multivalue
andreference-types
are now both enabled by default. These two features both have subtle changes implied for generated WebAssembly binaries. For themultivalue
feature, WebAssembly target support has changed when upgrading to LLVM 19. Support for generating functions with multiple returns no longer works and-Ctarget-feature=+multivalue
has a different meaning than it did in LLVM 18 and prior. There is no longer any supported means to generate a module that has a function with multiple returns in WebAssembly from Rust source code. For thereference-types
feature the encoding of immediates in thecall_indirect
, a commonly used instruction by the WebAssembly backend, has changed. Validators and parsers which don't understand thereference-types
proposal will no longer accept modules produced by LLVM due to this change in encoding of immediates. Additionally these features being enabled are encoded in thetarget_features
custom section and may affect downstream tooling such aswasm-opt
consuming the module. Generating a WebAssembly module that disables default features requires-Zbuild-std
support from Cargo and more information can be found at rust-lang/rust#128511. - Rust now raises unsafety errors for union patterns in parameter-position
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.
v1.81.0
==========================
Language
- Abort on uncaught panics in
extern "C"
functions. - Fix ambiguous cases of multiple
&
in elided self lifetimes. -
Stabilize
#[expect]
for lints (RFC 2383), like#[allow]
with a warning if the lint is not fulfilled. - Change method resolution to constrain hidden types instead of rejecting method candidates.
- Bump
elided_lifetimes_in_associated_constant
to deny. offset_from
: always allow pointers to point to the same address.- Allow constraining opaque types during subtyping in the trait system.
- Allow constraining opaque types during various unsizing casts.
- Deny keyword lifetimes pre-expansion.
Compiler
- Make casts of pointers to trait objects stricter.
- Check alias args for well-formedness even if they have escaping bound vars.
- Deprecate no-op codegen option
-Cinline-threshold=...
. - Re-implement a type-size based limit.
- Properly account for alignment in
transmute
size checks. - Remove the
box_pointers
lint. - Ensure the interpreter checks bool/char for validity when they are used in a cast.
- Improve coverage instrumentation for functions containing nested items.
- Target changes:
-
Add Tier 3
no_std
Xtensa targets:xtensa-esp32-none-elf
,xtensa-esp32s2-none-elf
,xtensa-esp32s3-none-elf
-
Add Tier 3
std
Xtensa targets:xtensa-esp32-espidf
,xtensa-esp32s2-espidf
,xtensa-esp32s3-espidf
-
Add Tier 3 i686 Redox OS target:
i686-unknown-redox
- Promote
arm64ec-pc-windows-msvc
to Tier 2. - Promote
loongarch64-unknown-linux-musl
to Tier 2 with host tools. - Enable full tools and profiler for LoongArch Linux targets.
-
Unconditionally warn on usage of
wasm32-wasi
. (see compatibility note below) - Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
-
Add Tier 3
Libraries
-
Split core's
PanicInfo
and std'sPanicInfo
. (see compatibility note below) - Generalize
{Rc,Arc}::make_mut()
to unsized types. -
Replace sort implementations with stable
driftsort
and unstableipnsort
. Allslice::sort*
andslice::select_nth*
methods are expected to see significant performance improvements. See the research project for more details. - Document behavior of
create_dir_all
with respect to empty paths. - Fix interleaved output in the default panic hook when multiple threads panic simultaneously.
- Fix
Command
's batch files argument escaping not working when file name has trailing whitespace or periods (CVE-2024-43402).
Stabilized APIs
core::error
hint::assert_unchecked
fs::exists
AtomicBool::fetch_not
Duration::abs_diff
IoSlice::advance
IoSlice::advance_slices
IoSliceMut::advance
IoSliceMut::advance_slices
PanicHookInfo
PanicInfo::message
PanicMessage
These APIs are now stable in const contexts:
-
char::from_u32_unchecked
(function) -
char::from_u32_unchecked
(method) CStr::count_bytes
CStr::from_ptr
Cargo
- Generated
.cargo_vcs_info.json
is always included, even when--allow-dirty
is passed. - Disallow
package.license-file
andpackage.readme
pointing to non-existent files during packaging. - Disallow passing
--release
/--debug
flag along with the--profile
flag. - Remove
lib.plugin
key support inCargo.toml
. Rust plugin support has been deprecated for four years and was removed in 1.75.0.
Compatibility Notes
-
Usage of the
wasm32-wasi
target will now issue a compiler warning and request users switch to thewasm32-wasip1
target instead. Both targets are the same,wasm32-wasi
is only being renamed, and this change to the WASI target is being done to enable removingwasm32-wasi
in January 2025. -
We have renamed
std::panic::PanicInfo
tostd::panic::PanicHookInfo
. The old name will continue to work as an alias, but will result in a deprecation warning starting in Rust 1.82.0.core::panic::PanicInfo
will remain unchanged, however, as this is now a different type.The reason is that these types have different roles:
std::panic::PanicHookInfo
is the argument to the panic hook in std context (where panics can have an arbitrary payload), whilecore::panic::PanicInfo
is the argument to the#[panic_handler]
in no_std context (where panics always carry a formatted message). Separating these types allows us to add more useful methods to these types, such asstd::panic::PanicHookInfo::payload_as_str()
andcore::panic::PanicInfo::message()
. -
The new sort implementations may panic if a type's implementation of
Ord
(or the given comparison function) does not implement a total order as the trait requires.Ord
's supertraits (PartialOrd
,Eq
, andPartialEq
) must also be consistent. The previous implementations would not "notice" any problem, but the new implementations have a good chance of detecting inconsistencies, throwing a panic rather than returning knowingly unsorted data.
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.
v1.80.1
===========================
- Fix miscompilation in the jump threading MIR optimization when comparing floats
- Revert changes to the
dead_code
lint from 1.80.0
v1.80.0
==========================
Language
- Document maximum allocation size
- Allow zero-byte offsets and ZST read/writes on arbitrary pointers
- Support C23's variadics without a named parameter
- Stabilize
exclusive_range_pattern
feature - Guarantee layout and ABI of
Result
in some scenarios
Compiler
- Update cc crate to v1.0.97 allowing additional spectre mitigations on MSVC targets
- Allow field reordering on types marked
repr(packed(1))
- Add a lint against never type fallback affecting unsafe code
- Disallow cast with trailing braced macro in let-else
- Expand
for_loops_over_fallibles
lint to lint on fallibles behind references. - self-contained linker: retry linking without
-fuse-ld=lld
on CCs that don't support it - Do not parse CVarArgs (
...
) as a type in trait bounds - Improvements to LLDB formatting #124458 #124500
- For the wasm32-wasip2 target default to PIC and do not use
-fuse-ld=lld
- Add x86_64-unknown-linux-none as a tier 3 target
- Lint on
foo.into_iter()
resolving to&Box<[T]>: IntoIterator
Libraries
- Add
size_of
andsize_of_val
andalign_of
andalign_of_val
to the prelude - Abort a process when FD ownership is violated
- io::Write::write_fmt: panic if the formatter fails when the stream does not fail
- Panic if
PathBuf::set_extension
would add a path separator - Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr} methods
- Update
c_char
on AIX to use the correct type offset_of!
no longer returns a temporary- Handle sigma in
str.to_lowercase
correctly - Raise
DEFAULT_MIN_STACK_SIZE
to at least 64KiB
Stabilized APIs
impl Default for Rc<CStr>
impl Default for Rc<str>
impl Default for Rc<[T]>
impl Default for Arc<str>
impl Default for Arc<CStr>
impl Default for Arc<[T]>
impl IntoIterator for Box<[T]>
impl FromIterator<String> for Box<str>
impl FromIterator<char> for Box<str>
LazyCell
LazyLock
Duration::div_duration_f32
Duration::div_duration_f64
Option::take_if
Seek::seek_relative
BinaryHeap::as_slice
NonNull::offset
NonNull::byte_offset
NonNull::add
NonNull::byte_add
NonNull::sub
NonNull::byte_sub
NonNull::offset_from
NonNull::byte_offset_from
NonNull::read
NonNull::read_volatile
NonNull::read_unaligned
NonNull::write
NonNull::write_volatile
NonNull::write_unaligned
NonNull::write_bytes
NonNull::copy_to
NonNull::copy_to_nonoverlapping
NonNull::copy_from
NonNull::copy_from_nonoverlapping
NonNull::replace
NonNull::swap
NonNull::drop_in_place
NonNull::align_offset
<[T]>::split_at_checked
<[T]>::split_at_mut_checked
str::split_at_checked
str::split_at_mut_checked
str::trim_ascii
str::trim_ascii_start
str::trim_ascii_end
<[u8]>::trim_ascii
<[u8]>::trim_ascii_start
<[u8]>::trim_ascii_end
Ipv4Addr::BITS
Ipv4Addr::to_bits
Ipv4Addr::from_bits
Ipv6Addr::BITS
Ipv6Addr::to_bits
Ipv6Addr::from_bits
Vec::<[T; N]>::into_flattened
<[[T; N]]>::as_flattened
<[[T; N]]>::as_flattened_mut
These APIs are now stable in const contexts:
Cargo
- Stabilize
-Zcheck-cfg
as always enabled - Warn, rather than fail publish, if a target is excluded
- Add special
check-cfg
lint config for theunexpected_cfgs
lint - Stabilize
cargo update --precise <yanked>
- Don't change file permissions on
Cargo.toml
when usingcargo add
- Support using
cargo fix
on IPv6-only networks
Rustdoc
- Allow searching for references
- Stabilize
custom_code_classes_in_docs
feature - fix: In cross-crate scenarios show enum variants on type aliases of enums
Compatibility Notes
- rustfmt estimates line lengths differently when using non-ascii characters
- Type aliases are now handled correctly in orphan check
- Allow instructing rustdoc to read from stdin via
-
std::env::{set_var, remove_var}
can no longer be converted to safe function pointers and no longer implement theFn
family of traits- Warn (or error) when
Self
constructor from outer item is referenced in inner nested item - Turn
indirect_structural_match
andpointer_structural_match
lints into hard errors - Make
where_clause_object_safety
lint a regular object safety violation - Turn
proc_macro_back_compat
lint into a hard error. - Detect unused structs even when implementing private traits
-
std::sync::ReentrantLockGuard<T>
is no longerSync
ifT: !Sync
which meansstd::io::StdoutLock
andstd::io::StderrLock
are no longer Sync -
Type inference will fail in some cases due to new implementations of
FromIterator for Box<str>
. Notably, this breaks versions of thetime
crate before 0.3.35, due to no longer inferring the implementation forBox<[_]>
.
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.
- Misc improvements to size of generated html by rustdoc e.g. #124738 and #123734
- MSVC targets no longer depend on libc
v1.79.0
==========================
Language
- Stabilize inline
const {}
expressions. - Prevent opaque types being instantiated twice with different regions within the same function.
- Stabilize WebAssembly target features that are in phase 4 and 5.
- Add the
redundant_lifetimes
lint to detect lifetimes which are semantically redundant. - Stabilize the
unnameable_types
lint for public types that can't be named. - Enable debuginfo in macros, and stabilize
-C collapse-macro-debuginfo
and#[collapse_debuginfo]
. - Propagate temporary lifetime extension into
if
andmatch
expressions. - Restrict promotion of
const fn
calls. - Warn against refining impls of crate-private traits with
refining_impl_trait
lint. - Stabilize associated type bounds (RFC 2289).
- Stabilize importing
main
from other modules or crates. - Check return types of function types for well-formedness
- Rework
impl Trait
lifetime inference - Change inductive trait solver cycles to be ambiguous
Compiler
- Define
-C strip
to only affect binaries, not artifacts like.pdb
. - Stabilize
-Crelro-level
for controlling runtime link hardening. -
Stabilize checking of
cfg
names and values at compile-time with--check-cfg
. Note that this only stabilizes the compiler part, the Cargo part is still unstable in this release. - Add
aarch64-apple-visionos
andaarch64-apple-visionos-sim
tier 3 targets. - Add
riscv32ima-unknown-none-elf
tier 3 target. -
Promote several Windows targets to tier 2:
aarch64-pc-windows-gnullvm
,i686-pc-windows-gnullvm
, andx86_64-pc-windows-gnullvm
.
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- Implement
FromIterator
for(impl Default + Extend, impl Default + Extend)
. - Implement
{Div,Rem}Assign<NonZero<X>>
onX
. - Document overrides of
clone_from()
in core/std. - Link MSVC default lib in core.
- Caution against using
transmute
between pointers and integers. - Enable frame pointers for the standard library.
Stabilized APIs
{integer}::unchecked_add
{integer}::unchecked_mul
{integer}::unchecked_sub
<[T]>::split_at_unchecked
<[T]>::split_at_mut_unchecked
<[u8]>::utf8_chunks
str::Utf8Chunks
str::Utf8Chunk
<*const T>::is_aligned
<*mut T>::is_aligned
NonNull::is_aligned
<*const [T]>::len
<*mut [T]>::len
<*const [T]>::is_empty
<*mut [T]>::is_empty
NonNull::<[T]>::is_empty
CStr::count_bytes
io::Error::downcast
num::NonZero<T>
path::absolute
proc_macro::Literal::byte_character
proc_macro::Literal::c_string
These APIs are now stable in const contexts:
Atomic*::into_inner
io::Cursor::new
io::Cursor::get_ref
io::Cursor::position
io::empty
io::repeat
io::sink
panic::Location::caller
panic::Location::file
panic::Location::line
panic::Location::column
Cargo
- Prevent dashes in
lib.name
, always normalizing to_
. - Stabilize MSRV-aware version requirement selection in
cargo add
. - Switch to using
gitoxide
by default for listing files.
Rustdoc
- Always display stability version even if it's the same as the containing item.
- Show a single search result for items with multiple paths.
- Support typing
/
in docs to begin a search.
Misc
Compatibility Notes
- Update the minimum external LLVM to 17.
RustcEncodable
andRustcDecodable
are soft-destabilized, to be removed from the prelude in next edition.-
The
wasm_c_abi
future-incompatibility lint will warn about use of the non-spec-compliant C ABI. Usewasm-bindgen v0.2.88
to generate forward-compatible bindings. - Check return types of function types for well-formedness
v1.78.0
==========================
Language
- Stabilize
#[cfg(target_abi = ...)]
- Stabilize the
#[diagnostic]
namespace and#[diagnostic::on_unimplemented]
attribute - Make async-fn-in-trait implementable with concrete signatures
- Make matching on NaN a hard error, and remove the rest of
illegal_floating_point_literal_pattern
- static mut: allow mutable reference to arbitrary types, not just slices and arrays
- Extend
invalid_reference_casting
to include references casting to bigger memory layout - Add
non_contiguous_range_endpoints
lint for singleton gaps after exclusive ranges -
Add
wasm_c_abi
lint for use of older wasm-bindgen versions This lint currently only works when using Cargo. - Update
indirect_structural_match
andpointer_structural_match
lints to match RFC - Make non-
PartialEq
-typed consts as patterns a hard error - Split
refining_impl_trait
lint into_reachable
,_internal
variants - Remove unnecessary type inference when using associated types inside of higher ranked
where
-bounds - Weaken eager detection of cyclic types during type inference
trait Trait: Auto {}
: allow upcasting fromdyn Trait
todyn Trait + Auto
Compiler
- Made
INVALID_DOC_ATTRIBUTES
lint deny by default - Increase accuracy of redundant
use
checking - Suggest moving definition if non-found macro_rules! is defined later
- Lower transmutes from int to pointer type as gep on null
Target changes:
- Windows tier 1 targets now require at least Windows 10
- Add
wasm32-wasip1
tier 2 (without host tools) target - Add
wasm32-wasip2
tier 3 target - Rename
wasm32-wasi-preview1-threads
towasm32-wasip1-threads
- Add
arm64ec-pc-windows-msvc
tier 3 target - Add
armv8r-none-eabihf
tier 3 target for the Cortex-R52 - Add
loongarch64-unknown-linux-musl
tier 3 target
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- Bump Unicode to version 15.1.0, regenerate tables
- Make align_offset, align_to well-behaved in all cases
- PartialEq, PartialOrd: document expectations for transitive chains
- Optimize away poison guards when std is built with panic=abort
- Replace pthread
RwLock
with custom implementation - Implement unwind safety for Condvar on all platforms
- Add ASCII fast-path for
char::is_grapheme_extended
Stabilized APIs
impl Read for &Stdin
- Accept non
'static
lifetimes for severalstd::error::Error
related implementations - Make
impl<Fd: AsFd>
impl take?Sized
impl From<TryReserveError> for io::Error
These APIs are now stable in const contexts:
Cargo
- Stabilize lockfile v4
- Respect
rust-version
when generating lockfile - Control
--charset
via auto-detecting config value - Support
target.<triple>.rustdocflags
officially - Stabilize global cache data tracking
Compatibility Notes
- Many unsafe precondition checks now run for user code with debug assertions enabled This change helps users catch undefined behavior in their code, though the details of how much is checked are generally not stable.
- riscv only supports split_debuginfo=off for now
- Consistently check bounds on hidden types of
impl Trait
- Change equality of higher ranked types to not rely on subtyping
- When called, additionally check bounds on normalized function return type
- Expand coverage for
arithmetic_overflow
lint -
Fix detection of potential interior mutability in
const
initializers This code was accidentally accepted. The fix can break generic code that borrows a value of unknown type, as there is currently no way to declare "this type has no interior mutability". In the future, stabilizing theFreeze
trait will allow proper support for such code.
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.
- Update to LLVM 18
- Build
rustc
with 1CGU onx86_64-pc-windows-msvc
- Build
rustc
with 1CGU onx86_64-apple-darwin
- Introduce
run-make
V2 infrastructure, arun_make_support
library and port over 2 tests as example - Windows: Implement condvar, mutex and rwlock using futex
v1.77.2
===========================
v1.77.1
===========================
- Revert stripping debuginfo by default for Windows This fixes a regression in 1.77 by reverting to the previous default. Platforms other than Windows are not affected.
- Internal: Fix heading anchor rendering in doc pages
v1.77.0
==========================
Language
- Reveal opaque types within the defining body for exhaustiveness checking.
- Stabilize C-string literals.
- Stabilize THIR unsafeck.
- Add lint
static_mut_refs
to warn on references to mutable statics. - Support async recursive calls (as long as they have indirection).
- Undeprecate lint
unstable_features
and make use of it in the compiler. - Make inductive cycles in coherence ambiguous always.
- Get rid of type-driven traversal in const-eval interning, only as a future compatiblity lint for now.
- Deny braced macro invocations in let-else.
Compiler
- Include lint
soft_unstable
in future breakage reports. - Make
i128
andu128
16-byte aligned on x86-based targets. - Use
--verbose
in diagnostic output. - Improve spacing between printed tokens.
- Merge the
unused_tuple_struct_fields
lint intodead_code
. - Error on incorrect implied bounds in well-formedness check, with a temporary exception for Bevy.
- Fix coverage instrumentation/reports for non-ASCII source code.
- Fix
fn
/const
items implied bounds and well-formedness check. - Promote
riscv32{im|imafc}-unknown-none-elf
targets to tier 2. - Add several new tier 3 targets:
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
Stabilized APIs
array::each_ref
array::each_mut
core::net
f32::round_ties_even
f64::round_ties_even
mem::offset_of!
slice::first_chunk
slice::first_chunk_mut
slice::split_first_chunk
slice::split_first_chunk_mut
slice::last_chunk
slice::last_chunk_mut
slice::split_last_chunk
slice::split_last_chunk_mut
slice::chunk_by
slice::chunk_by_mut
Bound::map
File::create_new
Mutex::clear_poison
RwLock::clear_poison
Cargo
- Extend the build directive syntax with
cargo::
. - Stabilize metadata
id
format asPackageIDSpec
. - Pull out
cargo-util-schemas
as a crate. - Strip all debuginfo when debuginfo is not requested.
- Inherit jobserver from env for all kinds of runners.
- Deprecate rustc plugin support in cargo.
Rustdoc
- Allows links in markdown headings.
- Search for tuples and unit by type with
()
. - Clean up the source sidebar's hide button.
- Prevent JS injection from
localStorage
.
Misc
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.
v1.76.0
==========================
Language
- Document Rust ABI compatibility between various types
- Also: guarantee that char and u32 are ABI-compatible
- Add lint
ambiguous_wide_pointer_comparisons
that supersedesclippy::vtable_address_comparisons
Compiler
- Lint pinned
#[must_use]
pointers (in particular,Box<T>
whereT
is#[must_use]
) inunused_must_use
. - Soundness fix: fix computing the offset of an unsized field in a packed struct
- Soundness fix: fix dynamic size/align computation logic for packed types with dyn Trait tail
- Add
$message_type
field to distinguish json diagnostic outputs - Enable Rust to use the EHCont security feature of Windows
- Add tier 3 {x86_64,i686}-win7-windows-msvc targets
- Add tier 3 aarch64-apple-watchos target
- Add tier 3 arm64e-apple-ios & arm64e-apple-darwin targets
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- Add a column number to
dbg!()
- Add
std::hash::{DefaultHasher, RandomState}
exports - Fix rounding issue with exponents in fmt
- Add T: ?Sized to
RwLockReadGuard
andRwLockWriteGuard
's Debug impls. - Windows: Allow
File::create
to work on hidden files
Stabilized APIs
Arc::unwrap_or_clone
Rc::unwrap_or_clone
Result::inspect
Result::inspect_err
Option::inspect
type_name_of_val
-
std::hash::{DefaultHasher, RandomState}
These were previously available only throughstd::collections::hash_map
. ptr::{from_ref, from_mut}
ptr::addr_eq
Cargo
See Cargo release notes.
Rustdoc
- Don't merge cfg and doc(cfg) attributes for re-exports
- rustdoc: allow resizing the sidebar / hiding the top bar
- rustdoc-search: add support for traits and associated types
- rustdoc: Add highlighting for comments in items declaration
Compatibility Notes
-
Add allow-by-default lint for unit bindings
This is expected to be upgraded to a warning by default in a future Rust
release. Some macros emit bindings with type
()
with user-provided spans, which means that this lint will warn for user code. - Remove x86_64-sun-solaris target.
- Remove asmjs-unknown-emscripten target
- Report errors in jobserver inherited through environment variables This may warn on benign problems too.
- Update the minimum external LLVM to 16.
-
Improve
print_tts
This change can break some naive manual parsing of token trees in proc macro code which expect a particular structure after.to_string()
, rather than just arbitrary Rust code. - Make
IMPLIED_BOUNDS_ENTAILMENT
into a hard error from a lint -
Vec's allocation behavior was changed when collecting some iterators
Allocation behavior is currently not specified, nevertheless changes can be surprising.
See
impl FromIterator for Vec
for more details. - Properly reject
default
on free const items
v1.75.0
==========================
Language
- Stabilize
async fn
and return-positionimpl Trait
in traits. - Allow function pointer signatures containing
&mut T
inconst
contexts. - Match
usize
/isize
exhaustively with half-open ranges. - Guarantee that
char
has the same size and alignment asu32
. - Document that the null pointer has the 0 address.
- Allow partially moved values in
match
. - Add notes about non-compliant FP behavior on 32bit x86 targets.
- Stabilize ratified RISC-V target features.
Compiler
- Rework negative coherence to properly consider impls that only partly overlap.
- Bump
COINDUCTIVE_OVERLAP_IN_COHERENCE
to deny, and warn in dependencies. - Consider alias bounds when computing liveness in NLL.
- Add the V (vector) extension to the
riscv64-linux-android
target spec. - Automatically enable cross-crate inlining for small functions
- Add several new tier 3 targets:
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- Override
Waker::clone_from
to avoid cloningWaker
s unnecessarily. - Implement
BufRead
forVecDeque<u8>
. - Implement
FusedIterator
forDecodeUtf16
when the inner iterator does. - Implement
Not, Bit{And,Or}{,Assign}
for IP addresses. - Implement
Default
forExitCode
. - Guarantee representation of None in NPO
- Document when atomic loads are guaranteed read-only.
- Broaden the consequences of recursive TLS initialization.
- Windows: Support sub-millisecond sleep.
- Fix generic bound of
str::SplitInclusive
'sDoubleEndedIterator
impl - Fix exit status / wait status on non-Unix
cfg(unix)
platforms.
Stabilized APIs
Atomic*::from_ptr
FileTimes
FileTimesExt
File::set_modified
File::set_times
IpAddr::to_canonical
Ipv6Addr::to_canonical
Option::as_slice
Option::as_mut_slice
pointer::byte_add
pointer::byte_offset
pointer::byte_offset_from
pointer::byte_sub
pointer::wrapping_byte_add
pointer::wrapping_byte_offset
pointer::wrapping_byte_sub
These APIs are now stable in const contexts:
Ipv6Addr::to_ipv4_mapped
MaybeUninit::assume_init_read
MaybeUninit::zeroed
mem::discriminant
mem::zeroed
Cargo
- Add new packages to
[workspace.members]
automatically. - Allow version-less
Cargo.toml
manifests. - Make browser links out of HTML file paths.
Rustdoc
- Accept less invalid Rust in rustdoc.
- Document lack of object safety on affected traits.
- Hide
#[repr(transparent)]
if it isn't part of the public ABI. - Show enum discriminant if it is a C-like variant.
Compatibility Notes
- FreeBSD targets now require at least version 12.
- Formally demote tier 2 MIPS targets to tier 3.
- Make misalignment a hard error in
const
contexts. - Fix detecting references to packed unsized fields.
- Remove support for compiler plugins.
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.
- Optimize
librustc_driver.so
with BOLT. - Enable parallel rustc front end in dev and nightly builds.
- Distribute
rustc-codegen-cranelift
as rustup component on the nightly channel.
v1.74.1
===========================
- Resolved spurious STATUS_ACCESS_VIOLATIONs in LLVM
- Clarify guarantees for std::mem::discriminant
- Fix some subtyping-related regressions
v1.74.0
==========================
Language
- Codify that
std::mem::Discriminant<T>
does not depend on any lifetimes in T -
Replace
private_in_public
lint withprivate_interfaces
andprivate_bounds
per RFC 2145. Read more in RFC 2145. - Allow explicit
#[repr(Rust)]
- closure field capturing: don't depend on alignment of packed fields
- Enable MIR-based drop-tracking for
async
blocks - Stabilize
impl_trait_projections
Compiler
- stabilize combining +bundle and +whole-archive link modifiers
- Stabilize
PATH
option for--print KIND=PATH
- Enable ASAN/LSAN/TSAN for
*-apple-ios-macabi
- Promote loongarch64-unknown-none* to Tier 2
- Add
i686-pc-windows-gnullvm
as a tier 3 target
Libraries
- Implement
From<OwnedFd/Handle>
for ChildStdin/out/err - Implement
From<{&,&mut} [T; N]>
forVec<T>
whereT: Clone
- impl Step for IP addresses
- Implement
From<[T; N]>
forRc<[T]>
andArc<[T]>
impl TryFrom<char> for u16
- Stabilize
io_error_other
feature - Stabilize the
Saturating
type - Stabilize const_transmute_copy
Stabilized APIs
core::num::Saturating
impl From<io::Stdout> for std::process::Stdio
impl From<io::Stderr> for std::process::Stdio
impl From<OwnedHandle> for std::process::Child{Stdin, Stdout, Stderr}
impl From<OwnedFd> for std::process::Child{Stdin, Stdout, Stderr}
std::ffi::OsString::from_encoded_bytes_unchecked
std::ffi::OsString::into_encoded_bytes
std::ffi::OsStr::from_encoded_bytes_unchecked
std::ffi::OsStr::as_encoded_bytes
std::io::Error::other
impl TryFrom<char> for u16
impl<T: Clone, const N: usize> From<&[T; N]> for Vec<T>
impl<T: Clone, const N: usize> From<&mut [T; N]> for Vec<T>
impl<T, const N: usize> From<[T; N]> for Arc<[T]>
impl<T, const N: usize> From<[T; N]> for Rc<[T]>
These APIs are now stable in const contexts:
Cargo
- In
Cargo.toml
, stabilize[lints]
- Stabilize credential-process and registry-auth
- Stabilize
--keep-going
build flag - Add styling to
--help
output - For
cargo clean
, add--dry-run
flag and summary line at the end - For
cargo update
, make--package
more convenient by being positional - For
cargo update
, clarify meaning of --aggressive as --recursive - Add '-n' as an alias for
--dry-run
- Allow version-prefixes in pkgid's (e.g.
--package
flags) to resolve ambiguities - In
.cargo/config.toml
, merge lists in precedence order - Add support for
target.'cfg(..)'.linker
Rustdoc
- Add warning block support in rustdoc
- rustdoc-search: add support for type parameters
- rustdoc: show inner enum and struct in type definition for concrete type
Compatibility Notes
- Raise minimum supported Apple OS versions
- make Cell::swap panic if the Cells partially overlap
- Reject invalid crate names in
--extern
- Don't resolve generic impls that may be shadowed by dyn built-in impls
-
The new
impl From<{&,&mut} [T; N]> for Vec<T>
is known to cause some inference failures with overly-generic code. In those examples using thetui
crate, the combination ofAsRef<_>
andInto<Vec>
leaves the middle type ambiguous, and the newimpl
adds another possibility, so it now requires an explicit type annotation.
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.
None this cycle.
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.