Rust 1.60.0
Language
- Stabilize
#[cfg(panic = "...")]
for either"unwind"
or"abort"
. - Stabilize
#[cfg(target_has_atomic = "...")]
for each integer size and"ptr"
.
Compiler
- Enable combining
+crt-static
andrelocation-model=pic
onx86_64-unknown-linux-gnu
- Fixes wrong
unreachable_pub
lints on nested and glob public reexport - Stabilize
-Z instrument-coverage
as-C instrument-coverage
- Stabilize
-Z print-link-args
as--print link-args
- Add new Tier 3 target
mips64-openwrt-linux-musl
* - Add new Tier 3 target
armv7-unknown-linux-uclibceabi
(softfloat)* - Fix invalid removal of newlines from doc comments
- Add kernel target for RustyHermit
- Deny mixing bin crate type with lib crate types
- Make rustc use
RUST_BACKTRACE=full
by default - Upgrade to LLVM 14
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Guarantee call order for
sort_by_cached_key
- Improve
Duration::try_from_secs_f32
/f64
accuracy by directly processing exponent and mantissa - Make
Instant::{duration_since, elapsed, sub}
saturating - Remove non-monotonic clocks workarounds in
Instant::now
- Make
BuildHasherDefault
,iter::Empty
andfuture::Pending
covariant
Stabilized APIs
Arc::new_cyclic
Rc::new_cyclic
slice::EscapeAscii
<[u8]>::escape_ascii
u8::escape_ascii
Vec::spare_capacity_mut
MaybeUninit::assume_init_drop
MaybeUninit::assume_init_read
i8::abs_diff
i16::abs_diff
i32::abs_diff
i64::abs_diff
i128::abs_diff
isize::abs_diff
u8::abs_diff
u16::abs_diff
u32::abs_diff
u64::abs_diff
u128::abs_diff
usize::abs_diff
Display for io::ErrorKind
From<u8> for ExitCode
Not for !
(the "never" type)- _Op_
Assign<$t> for Wrapping<$t>
arch::is_aarch64_feature_detected!
Cargo
- Port cargo from
toml-rs
totoml_edit
- Stabilize
-Ztimings
as--timings
- Stabilize namespaced and weak dependency features.
- Accept more
cargo:rustc-link-arg-*
types from build script output. - cargo-new should not add ignore rule on Cargo.lock inside subdirs
Misc
- Ship docs on Tier 2 platforms by reusing the closest Tier 1 platform docs
- Drop rustc-docs from complete profile
- bootstrap: tidy up flag handling for llvm build
Compatibility Notes
- Remove compiler-rt linking hack on Android
- Mitigations for platforms with non-monotonic clocks have been removed from
Instant::now
. On platforms that don't provide monotonic clocks, an instant is not guaranteed to be greater than an earlier instant anymore. Instant::{duration_since, elapsed, sub}
do not panic anymore on underflow, saturating to0
instead. In the real world the panic happened mostly on platforms with buggy monotonic clock implementations rather than catching programming errors like reversing the start and end times. Such programming errors will now results in0
rather than a panic.- In a future release we're planning to increase the baseline requirements for the Linux kernel to version 3.2, and for glibc to version 2.17. We'd love your feedback in PR #95026.
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.