Chapter 5. Changes in Rust 1.39 Toolset

Rust Toolset has been updated from version 1.37 to 1.39. Notable changes include:

  • The async - .await syntax has been added to stable Rust. You can now define async functions and blocks and .await them.
  • Enhanced pipelined compilation improves build time for optimized, clean builds of some crate graphs by 10-20%.
  • When the by-move bindings are in the main pattern of a match expression, if guards can now reference those bindings.
  • Rust is supposed to detect memory-safety bugs at compile time, but the previous borrow checker had limitations and allowed undefined behavior and memory unsafety. The new NLL borrow checker can find these problems and was raising warnings about that as a migration step. These warnings are now hard errors.
  • The rustc compiler now provides a lint when functions mem::{uninitialized, zeroed} are used to initialize some of the types, for example, &T and Box<T>.
  • The following functions are now const fn in the standard library: Vec::new, String::new, LinkedList::new, str::len, [T]::len, str::as_bytes, abs, wrapping_abs, and overflowing_abs.