Language
- You can now use const values for x in [x; N] array expressions. This has been technically possible since 1.38.0, as it was unintentionally stabilized.
- Assignments to ManuallyDrop<T> union fields are now considered safe.
Compiler
- Added tier 3* support for the armv5te-unknown-linux-uclibceabi target.
- Added tier 3 support for the aarch64-apple-ios-macabi target.
- The x86_64-unknown-freebsd is now built with the full toolset.
- Dropped support for all cloudabi targets.
- Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Libraries
- proc_macro::Punct now implements PartialEq<char>.
- ops::{Index, IndexMut} are now implemented for fixed sized arrays of any length.
- On Unix platforms, the std::fs::File type now has a “niche” of -1. This value cannot be a valid file descriptor, and now means Option<File> takes up the same amount of space as File.
Stabilized APIs
- bool::then
- btree_map::Entry::or_insert_with_key
- f32::clamp
- f64::clamp
- hash_map::Entry::or_insert_with_key
- Ord::clamp
- RefCell::take
- slice::fill
- UnsafeCell::get_mut
The following previously stable methods are now const.
- IpAddr::is_ipv4
- IpAddr::is_ipv6
- Layout::size
- Layout::align
- Layout::from_size_align
- pow for all integer types.
- checked_pow for all integer types.
- saturating_pow for all integer types.
- wrapping_pow for all integer types.
- next_power_of_two for all unsigned integer types.
- checked_power_of_two for all unsigned integer types.
Cargo
- Added the [build.rustc-workspace-wrapper] option. This option sets a wrapper to execute instead of rustc, for workspace members only.
- cargo:rerun-if-changed will now, if provided a directory, scan the entire contents of that directory for changes.
- Added the –workspace flag to the cargo update command.
Misc
- The search results tab and the help button are focusable with keyboard in rustdoc.
- Running tests will now print the total time taken to execute.