Rest 1.36

The development team is excited to bring you Rust 1.36!

What's new in Rust 1.36?
Future trait stabilized, from new: alloc, MaybeUninit trait , NLL for Rust 2015, a new HashMap implementation and a new --offline flag for Cargo.


And now more:

  • In Rust 1.36 finally stabilized trait Future.
  • Alloc crate.
    As of Rust 1.36, parts of std that depend on a global allocator (such as Vec ) are in the alloc crate. Now std will re-export those parts. More about it.
  • MaybeUninit instead of mem::uninitialized.
    In previous releases, mem::uninitialized allowed you to bypass the initialization check, it was used for lazy array allocation, but this function is quite dangerous (more), so the MaybeUninit type has been stabilized which is safer.
    Well, since MaybeUninit is a safer alternative, mem::uninitialized will be deprecated as of Rust 1.38.
    If you want to know more about uninitialized memory, you can read the blog post (Alexis Beingessner).
  • NLL for Rust 2015.
    In the announcement Rest 1.31.0 developers have been telling us about NLL (Non-Lexical Lifetime), a language enhancement that makes the borrow checker smarter and more user friendly. Example:
    fnmain() {
    let mut x = 5;
    let y = &x;
    let z = &mut x; // This was not allowed before 1.31.0.
    }

    In 1.31.0, NLL only worked in Rust 2018, with the promise that developers will add support to Rust 2015 as well.
    If you want to know more about NLL, you can read more in this blog entries (Felix Klocks).

  • New flag for Cargo is --offline.
    Rust 1.36 stabilized a new flag for Cargo. The --offline flag tells Cargo to use locally cached dependencies so that they can be used offline later. When the required dependencies are not available offline, and if the Internet is still needed, then Cargo will return an error. To prefetch dependencies, you can use the cargo fetch command, which will download all dependencies.
  • Here you can read a more detailed overview of the changes.

There are also changes in the standard library:

Other changes Rust, Job ΠΈ Clippy.

Source: linux.org.ru

Add a comment