Version 1.70.0 (2023-06-01)
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][platform-support-doc] 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.