Version 1.57.0 (2021-12-02)
Language
- Macro attributes may follow
#[derive]and will see the original (pre-cfg) input. - Accept curly-brace macros in expressions, like
m!{ .. }.method()andm!{ .. }?. - Allow panicking in constant evaluation.
- Ignore derived
CloneandDebugimplementations during dead code analysis.
Compiler
- Create more accurate debuginfo for vtables.
- Add
armv6k-nintendo-3dsat Tier 3*. - Add
armv7-unknown-linux-uclibceabihfat Tier 3*. - Add
m68k-unknown-linux-gnuat Tier 3*. - Add SOLID targets at Tier 3*:
aarch64-kmc-solid_asp3,armv7a-kmc-solid_asp3-eabi,armv7a-kmc-solid_asp3-eabihf
* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- Avoid allocations and copying in
Vec::leak - Add
#[repr(i8)]toOrdering - Optimize
File::read_to_endandread_to_string - Update to Unicode 14.0
- Many more functions are marked
#[must_use], producing a warning when ignoring their return value. This helps catch mistakes such as expecting a function to mutate a value in place rather than return a new value.
Stabilised APIs
[T; N]::as_mut_slice[T; N]::as_slicecollections::TryReserveErrorHashMap::try_reserveHashSet::try_reserveString::try_reserveString::try_reserve_exactVec::try_reserveVec::try_reserve_exactVecDeque::try_reserveVecDeque::try_reserve_exactIterator::map_whileiter::MapWhileproc_macro::is_availableCommand::get_programCommand::get_argsCommand::get_envsCommand::get_current_dirCommandArgsCommandEnvs
These APIs are now usable in const contexts:
- [
hint::unreachable_unchecked]
Cargo
Compatibility notes
- Ignore derived
CloneandDebugimplementations during dead code analysis. This will break some builds that set#![deny(dead_code)].
Internal changes
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.