Rust 1.66.0
Released on December 15, 2022
What's Changed
- Permit specifying explicit discriminants on all
repr(Int)enums - Allow transmutes between the same type differing only in lifetimes
- Change constant evaluation errors from a deny-by-default lint to a hard error
- Trigger
must_useonimpl Traitfor supertraits - Allow
..=Xin patterns - Uplift
clippy::for_loops_over_fallibleslint into rustc - Stabilize
symoperands in inline assembly - Update to Unicode 15
- Opaque types no longer imply lifetime bounds
- Add armv5te-none-eabi and thumbv5te-none-eabi tier 3 targets
- Refer to Rust's [platform support page][platform-support-doc] for more
- Add support for linking against macOS universal libraries
- Fix
#[derive(Default)]on a generic#[default]enum adding unnecessaryDefaultbounds - Update to Unicode 15
proc_macro::Span::source_textuX::{checked_add_signed, overflowing_add_signed, saturating_add_signed, wrapping_add_signed}iX::{checked_add_unsigned, overflowing_add_unsigned, saturating_add_unsigned, wrapping_add_unsigned}iX::{checked_sub_unsigned, overflowing_sub_unsigned, saturating_sub_unsigned, wrapping_sub_unsigned}BTreeSet::{first, last, pop_first, pop_last}BTreeMap::{first_key_value, last_key_value, first_entry, last_entry, pop_first, pop_last}- Add
AsFdimplementations for stdio lock types on WASI. impl TryFrom> for Box<[T; N]> core::hint::black_boxDuration::try_from_secs_{f32,f64}Option::unzipstd::os::fd
- Only apply
ProceduralMasqueradehack to older versions ofrental - Don't export
__heap_baseand__data_endon wasm32-wasi. - Don't export
__wasm_init_memoryon WebAssembly. - Only export
__tls_*on wasm32-unknown-unknown. - Don't link to
libresolvin libstd on Darwin - Update libstd's libc to 0.2.135 (to make
libstdno longer pull inlibiconv.dylibon Darwin) - Opaque types no longer imply lifetime bounds
- Make
order_dependent_trait_objectsshow up in future-breakage reports - Change std::process::Command spawning to default to inheriting the parent's signal mask
Full Changelog
Language
--------
- Permit specifying explicit discriminants on all repr(Int) enums
#[repr(u8)]
enum Foo {
A(u8) = 0,
B(i8) = 1,
C(bool) = 42,
}
- Allow transmutes between the same type differing only in lifetimes
- Change constant evaluation errors from a deny-by-default lint to a hard error
- Trigger must_use on impl Trait for supertraits
This makes impl ExactSizeIterator respect the existing #[must_use] annotation on Iterator.
- Uplift clippy::for_loops_over_fallibles lint into rustc
- Stabilize sym operands in inline assembly
- Opaque types no longer imply lifetime bounds
This is a soundness fix which may break code that was erroneously relying on this behavior.
Compiler
--------
- Add armv5te-none-eabi and thumbv5te-none-eabi tier 3 targets
- Refer to Rust's [platform support page][platform-support-doc] for more
information on Rust's tiered platform support.
- Add support for linking against macOS universal libraries
Libraries
---------
- Fix #[derive(Default)] on a generic #[default] enum adding unnecessary Default bounds
Stabilized APIs
---------------
- proc_macro::Span::source_text
- uX::{checked_add_signed, overflowing_add_signed, saturating_add_signed, wrapping_add_signed}
- iX::{checked_add_unsigned, overflowing_add_unsigned, saturating_add_unsigned, wrapping_add_unsigned}
- iX::{checked_sub_unsigned, overflowing_sub_unsigned, saturating_sub_unsigned, wrapping_sub_unsigned}
- BTreeSet::{first, last, pop_first, pop_last}
- BTreeMap::{first_key_value, last_key_value, first_entry, last_entry, pop_first, pop_last}
- Add AsFd implementations for stdio lock types on WASI.
- impl TryFrom
- Duration::try_from_secs_{f32,f64}
Rustdoc
-------
- Add Rustdoc warning for invalid HTML tags in the documentation
Cargo
-----
- Added cargo remove to remove dependencies from Cargo.toml
- cargo publish now waits for the new version to be downloadable before exiting
See detailed release notes for more.
Compatibility Notes
-------------------
- Only apply ProceduralMasquerade hack to older versions of rental
- Don't export __heap_base and __data_end on wasm32-wasi.
- Don't export __wasm_init_memory on WebAssembly.
- Only export __tls_* on wasm32-unknown-unknown.
- Don't link to libresolv in libstd on Darwin
- Update libstd's libc to 0.2.135 (to make libstd no longer pull in libiconv.dylib on Darwin)
- Opaque types no longer imply lifetime bounds
This is a soundness fix which may break code that was erroneously relying on this behavior.
- Make order_dependent_trait_objects show up in future-breakage reports
- Change std::process::Command spawning to default to inheriting the parent's signal mask
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.