1.50.0 #
- Released on: 11 February, 2021
- Branched from master on: 25 December, 2020
Language #
- You can now use
constvalues forxin[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-uclibceabitarget. - Added tier 3 support for the
aarch64-apple-ios-macabitarget. - The
x86_64-unknown-freebsdis now built with the full toolset. - Dropped support for all cloudabi targets.
* Refer to Rust’s [platform support page][platform-support-doc] for more information on Rust’s tiered platform support.
Libraries #
proc_macro::Punctnow implementsPartialEq<char>.ops::{Index, IndexMut}are now implemented for fixed sized arrays of any length.- On Unix platforms, the
std::fs::Filetype now has a “niche” of-1. This value cannot be a valid file descriptor, and now meansOption<File>takes up the same amount of space asFile.
Stabilized APIs #
bool::thenbtree_map::Entry::or_insert_with_keyf32::clampf64::clamphash_map::Entry::or_insert_with_keyOrd::clampRefCell::takeslice::fillUnsafeCell::get_mut
The following previously stable methods are now const.
IpAddr::is_ipv4IpAddr::is_ipv6IpAddr::is_unspecifiedIpAddr::is_loopbackIpAddr::is_multicastIpv4Addr::octetsIpv4Addr::is_loopbackIpv4Addr::is_privateIpv4Addr::is_link_localIpv4Addr::is_multicastIpv4Addr::is_broadcastIpv4Addr::is_documentationIpv4Addr::to_ipv6_compatibleIpv4Addr::to_ipv6_mappedIpv6Addr::segmentsIpv6Addr::is_unspecifiedIpv6Addr::is_loopbackIpv6Addr::is_multicastIpv6Addr::to_ipv4Layout::sizeLayout::alignLayout::from_size_alignpowfor all integer types.checked_powfor all integer types.saturating_powfor all integer types.wrapping_powfor all integer types.next_power_of_twofor all unsigned integer types.checked_next_power_of_twofor all unsigned integer types.
Cargo #
- Added the
[build.rustc-workspace-wrapper]option. This option sets a wrapper to execute instead ofrustc, for workspace members only. cargo:rerun-if-changedwill now, if provided a directory, scan the entire contents of that directory for changes.- Added the
--workspaceflag to thecargo updatecommand.
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.
Compatibility Notes #
- The
compare_and_swapmethod on atomics has been deprecated. It’s recommended to use thecompare_exchangeandcompare_exchange_weakmethods instead. - Changes in how
TokenStreams are checked have fixed some cases where you could write unhygenicmacro_rules!macros. #![test]as an inner attribute is now considered unstable like other inner macro attributes, and reports an error by default through thesoft_unstablelint.- Overriding a
forbidlint at the same level that it was set is now a hard error. - You can no longer intercept
panic!calls by supplying your own macro. It’s recommended to use the#[panic_handler]attribute to provide your own implementation. - Semi-colons after item statements (e.g.
struct Foo {};) now produce a warning.