Email me

Rust versions / 1.60

Rust release · Apr 7, 2022

Rust 1.60: what's new, what was stabilized

Short answerRust 1.60 was released on Apr 7, 2022: 2 language stabilizations ([Stabilize #[cfg(panic = "...")] for either "unwind" or "abort".][93658]); 25 newly stable APIs (Arc::new_cyclic, Rc::new_cyclic, slice::EscapeAscii, <[u8]>::escape_ascii, ...); 4 compatibility notes that can affect existing code.

Apr 7, 2022release date
2language stabilizations
25APIs stabilized
-new edition

← Rust 1.59All versionsRust 1.61 →

Language features stabilized

  • [Stabilize #[cfg(panic = "...")] for either "unwind" or "abort".][93658]
  • [Stabilize #[cfg(target_has_atomic = "...")] for each integer size and "ptr".][93824]

25 APIs stabilized

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 !, Assign<$t> for Wrapping<$t>, arch::is_aarch64_feature_detected!

Can it break my build?

The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:

  • [Remove compiler-rt linking hack on Android][83822]
  • [Mitigations for platforms with non-monotonic clocks have been removed from
  • [Instant::{duration_since, elapsed, sub} do not panic anymore on underflow,
  • In a future release we're planning to increase the baseline requirements for

Use it

rustup update stable        # get the newest release
rustup install 1.60          # or exactly this one
rustup override set 1.60     # pin a project to it

To require at least this version from users of your crate, set rust-version = "1.60" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.

Full release notes

Language

  • [Stabilize #[cfg(panic = "...")] for either "unwind" or "abort".][93658]
  • [Stabilize #[cfg(target_has_atomic = "...")] for each integer size and "ptr".][93824]

Compiler

  • [Enable combining +crt-static and relocation-model=pic on x86_64-unknown-linux-gnu][86374]
  • [Fixes wrong unreachable_pub lints on nested and glob public reexport][87487]
  • [Stabilize -Z instrument-coverage as -C instrument-coverage][90132]
  • [Stabilize -Z print-link-args as --print link-args][91606]
  • [Add new Tier 3 target mips64-openwrt-linux-musl\*][92300]
  • [Add new Tier 3 target armv7-unknown-linux-uclibceabi (softfloat)\*][92383]
  • [Fix invalid removal of newlines from doc comments][92357]
  • [Add kernel target for RustyHermit][92670]
  • [Deny mixing bin crate type with lib crate types][92933]
  • [Make rustc use RUST_BACKTRACE=full by default][93566]
  • [Upgrade to LLVM 14][93577]

\* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

  • [Guarantee call order for sort_by_cached_key][89621]
  • [Improve Duration::try_from_secs_f32/f64 accuracy by directly processing exponent and mantissa][90247]
  • [Make Instant::{duration_since, elapsed, sub} saturating][89926]
  • [Remove non-monotonic clocks workarounds in Instant::now][89926]
  • [Make BuildHasherDefault, iter::Empty and future::Pending covariant][92630]

Stabilized APIs

  • [Arc::new_cyclic][arc_new_cyclic]
  • [Rc::new_cyclic][rc_new_cyclic]
  • [slice::EscapeAscii][slice_escape_ascii]
  • [<[u8]>::escape_ascii][slice_u8_escape_ascii]
  • [u8::escape_ascii][u8_escape_ascii]
  • [Vec::spare_capacity_mut][vec_spare_capacity_mut]
  • [MaybeUninit::assume_init_drop][assume_init_drop]
  • [MaybeUninit::assume_init_read][assume_init_read]
  • [i8::abs_diff][i8_abs_diff]
  • [i16::abs_diff][i16_abs_diff]
  • [i32::abs_diff][i32_abs_diff]
  • [i64::abs_diff][i64_abs_diff]
  • [i128::abs_diff][i128_abs_diff]
  • [isize::abs_diff][isize_abs_diff]
  • [u8::abs_diff][u8_abs_diff]
  • [u16::abs_diff][u16_abs_diff]
  • [u32::abs_diff][u32_abs_diff]
  • [u64::abs_diff][u64_abs_diff]
  • [u128::abs_diff][u128_abs_diff]
  • [usize::abs_diff][usize_abs_diff]
  • [Display for io::ErrorKind][display_error_kind]
  • [From<u8> for ExitCode][from_u8_exit_code]
  • [Not for ! (the "never" type)][not_never]
  • [_Op_Assign<$t> for Wrapping<$t>][wrapping_assign_ops]
  • [arch::is_aarch64_feature_detected!][is_aarch64_feature_detected]

Cargo

  • [Port cargo from toml-rs to toml_edit][cargo/10086]
  • [Stabilize -Ztimings as --timings][cargo/10245]
  • [Stabilize namespaced and weak dependency features.][cargo/10269]
  • [Accept more cargo:rustc-link-arg-* types from build script output.][cargo/10274]
  • [cargo-new should not add ignore rule on Cargo.lock inside subdirs][cargo/10379]

Misc

  • [Ship docs on Tier 2 platforms by reusing the closest Tier 1 platform docs][92800]
  • [Drop rustc-docs from complete profile][93742]
  • [bootstrap: tidy up flag handling for llvm build][93918]

Compatibility Notes

  • [Remove compiler-rt linking hack on Android][83822]
  • [Mitigations for platforms with non-monotonic clocks have been removed from Instant::now][89926]. 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 to 0 instead][89926]. 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 result in 0 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][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.

Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.

← Rust 1.59All versionsRust 1.61 →

Up next

Next releaseRust 1.61Released May 19, 2022.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ