Email me

Rust versions / 1.34

Rust release · Apr 11, 2019

Rust 1.34: what's new, what was stabilized

Short answerRust 1.34 was released on Apr 11, 2019: 30 newly stable APIs (Any::type_id, Error::type_id, atomic::AtomicI16, atomic::AtomicI32, ...); 2 compatibility notes that can affect existing code. Point releases: 1.34.1 (Apr 25, 2019), 1.34.2 (May 14, 2019).

Apr 11, 2019release date
0language stabilizations
30APIs stabilized
-new edition

← Rust 1.33All versionsRust 1.35 →

30 APIs stabilized

Any::type_id, Error::type_id, atomic::AtomicI16, atomic::AtomicI32, atomic::AtomicI64, atomic::AtomicI8, atomic::AtomicU16, atomic::AtomicU32, atomic::AtomicU64, atomic::AtomicU8, convert::Infallible, convert::TryFrom, convert::TryInto, iter::from_fn, iter::successors, num::NonZeroI128, num::NonZeroI16, num::NonZeroI32, num::NonZeroI64, num::NonZeroI8, num::NonZeroIsize, slice::sort_by_cached_key, str::escape_debug, str::escape_default, str::escape_unicode, str::split_ascii_whitespace, Instant::checked_add, Instant::checked_sub, SystemTime::checked_add, SystemTime::checked_sub

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:

  • [Command::before_exec is being replaced by the unsafe method
  • [Use of ATOMIC_{BOOL, ISIZE, USIZE}_INIT is now deprecated][57425] as you

Use it

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

To require at least this version from users of your crate, set rust-version = "1.34" 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

  • [You can now use #[deprecated = "reason"]][58166] as a shorthand for #[deprecated(note = "reason")]. This was previously allowed by mistake but had no effect.
  • [You can now accept token streams in #[attr()],#[attr[]], and #[attr{}] procedural macros.][57367]
  • [You can now write extern crate self as foo;][57407] to import your crate's root into the extern prelude.

Compiler

  • [You can now target riscv64imac-unknown-none-elf and riscv64gc-unknown-none-elf.][58406]
  • [You can now enable linker plugin LTO optimisations with -C linker-plugin-lto.][58057] This allows rustc to compile your Rust code into LLVM bitcode allowing LLVM to perform LTO optimisations across C/C++ FFI boundaries.
  • [You can now target powerpc64-unknown-freebsd.][57809]

Libraries

  • [The trait bounds have been removed on some of HashMap<K, V, S>'s and HashSet<T, S>'s basic methods.][58370] Most notably you no longer require the Hash trait to create an iterator.
  • [The Ord trait bounds have been removed on some of BinaryHeap<T>'s basic methods.][58421] Most notably you no longer require the Ord trait to create an iterator.
  • [The methods overflowing_neg and wrapping_neg are now const functions for all numeric types.][58044]
  • [Indexing a str is now generic over all types that implement SliceIndex<str>.][57604]
  • [str::trim, str::trim_matches, str::trim_{start, end}, and str::trim_{start, end}_matches are now #[must_use]][57106] and will produce a warning if their returning type is unused.
  • [The methods checked_pow, saturating_pow, wrapping_pow, and overflowing_pow are now available for all numeric types.][57873] These are equivalent to methods such as wrapping_add for the pow operation.

Stabilized APIs

std & core

  • [Any::type_id]
  • [Error::type_id]
  • [atomic::AtomicI16]
  • [atomic::AtomicI32]
  • [atomic::AtomicI64]
  • [atomic::AtomicI8]
  • [atomic::AtomicU16]
  • [atomic::AtomicU32]
  • [atomic::AtomicU64]
  • [atomic::AtomicU8]
  • [convert::Infallible]
  • [convert::TryFrom]
  • [convert::TryInto]
  • [iter::from_fn]
  • [iter::successors]
  • [num::NonZeroI128]
  • [num::NonZeroI16]
  • [num::NonZeroI32]
  • [num::NonZeroI64]
  • [num::NonZeroI8]
  • [num::NonZeroIsize]
  • [slice::sort_by_cached_key]
  • [str::escape_debug]
  • [str::escape_default]
  • [str::escape_unicode]
  • [str::split_ascii_whitespace]

std

  • [Instant::checked_add]
  • [Instant::checked_sub]
  • [SystemTime::checked_add]
  • [SystemTime::checked_sub]

Cargo

  • [You can now use alternative registries to crates.io.][cargo/6654]

Misc

  • [You can now use the ? operator in your documentation tests without manually adding fn main() -> Result<(), _> {}.][56470]

Compatibility Notes

1.34.1 (Apr 25, 2019)

1.34.2 (May 14, 2019)

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

← Rust 1.33All versionsRust 1.35 →

Up next

Next releaseRust 1.35Released May 23, 2019.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