Email me

Rust versions / 1.39

Rust release · Nov 7, 2019

Rust 1.39: what's new, what was stabilized

Short answerRust 1.39 was released on Nov 7, 2019: 3 newly stable APIs (Pin::into_inner, Instant::checked_duration_since, Instant::saturating_duration_since); 4 compatibility notes that can affect existing code.

Nov 7, 2019release date
0language stabilizations
3APIs stabilized
-new edition

← Rust 1.38All versionsRust 1.40 →

3 APIs stabilized

Pin::into_inner, Instant::checked_duration_since, Instant::saturating_duration_since

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:

  • [Code that was previously accepted by the old borrow checker, but rejected by
  • [rustdoc now requires rustc to be installed and in the same directory to
  • [The try! macro will now issue a deprecation warning.][62672] It is
  • [asinh(-0.0) now correctly returns -0.0.][63698] Previously this

Use it

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

To require at least this version from users of your crate, set rust-version = "1.39" 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 create async functions and blocks with async fn, async move {}, and async {} respectively, and you can now call .await on async expressions.][63209]
  • [You can now use certain attributes on function, closure, and function pointer parameters.][64010] These attributes include cfg, cfg_attr, allow, warn, deny, forbid as well as inert helper attributes used by procedural macro attributes applied to items. e.g. ``rust fn len( #[cfg(windows)] slice: &[u16], #[cfg(not(windows))] slice: &[u8], ) -> usize { slice.len() } ``
  • [You can now take shared references to bind-by-move patterns in the if guards of match arms.][63118] e.g. ```rust fn main() { let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]);

match array { nums // ---- nums is bound by move. if nums.iter().sum::<u8>() == 10 // ^------ .iter() implicitly takes a reference to nums. => { drop(nums); // ----------- Legal as nums was bound by move and so we have ownership. } _ => unreachable!(), } } ```

Compiler

  • [Added tier 3\* support for the i686-unknown-uefi target.][64334]
  • [Added tier 3 support for the sparc64-unknown-openbsd target.][63595]
  • [rustc will now trim code snippets in diagnostics to fit in your terminal.][63402] **Note** Cargo currently doesn't use this feature. Refer to [cargo#7315][cargo/7315] to track this feature's progress.
  • [You can now pass --show-output argument to test binaries to print the output of successful tests.][62600]

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

Libraries

  • [Vec::new and String::new are now const functions.][64028]
  • [LinkedList::new is now a const function.][63684]
  • [str::len, [T]::len and str::as_bytes are now const functions.][63770]
  • [The abs, wrapping_abs, and overflowing_abs numeric functions are now const.][63786]

Stabilized APIs

  • [Pin::into_inner]
  • [Instant::checked_duration_since]
  • [Instant::saturating_duration_since]

Cargo

  • [You can now publish git dependencies if supplied with a version.][cargo/7237]
  • [The --all flag has been renamed to --workspace.][cargo/7241] Using --all is now deprecated.

Misc

  • [You can now pass -Clinker to rustdoc to control the linker used for compiling doctests.][63834]

Compatibility Notes

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

← Rust 1.38All versionsRust 1.40 →

Up next

Next releaseRust 1.40Released Dec 19, 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