Latest in branch 1.36
1.36.0
Released 04 Jul 2019
(6 years ago)
SoftwareRust
Version1.36
Initial release1.36.0
04 Jul 2019
(6 years ago)
Latest release1.36.0
04 Jul 2019
(6 years ago)
Support status16 Aug 2019
(Ended 6 years, 9 months ago)
Release noteshttps://github.com/rust-lang/rust/releases/tag/1.36.0
Source codehttps://github.com/rust-lang/rust/tree/1.36.0
Downloadhttps://github.com/rust-lang/rust/releases/tag/1.36.0
Rust 1.36 ReleasesView full list

What Is New in Rust 1.36

Category Highlights
New Features Future trait stabilized; alloc crate stabilized; MaybeUninit type; NLL back-ported to Rust 2015; new HashMap implementation (hashbrown-based); Cargo --offline flag
Improvements Faster, lower-overhead HashMap; dbg! macro now accepts multiple arguments; several APIs marked const
Deprecations mem::uninitialized slated for deprecation (replaced by MaybeUninit)

How does stabilizing the Future trait affect async development?

In Rust 1.36 the Future trait is now stable, giving library authors a solid foundation for async APIs.

Before this release async/await syntax was gated behind nightly, but the underlying trait could not be used in stable code. With the trait stabilized you can now write generic async combinators, expose async functions in public crates, and prepare for the upcoming .await syntax without forcing users onto nightly.

use std::future::Future;

fn async_identity(val: T) -> impl Future<Output = T> {
    async move { val }
}

In practice this means you can ship a library that returns impl Future today and your downstream users will be able to await it once the language feature lands.

What is the alloc crate and how does it enable no_std library development?

The alloc crate is now stable, exposing allocation-related types (e.g., Vec, String, Box) without pulling in the full std library.

This matters if you maintain a #![no_std] library that needs heap allocation but wants to stay on the stable channel. You can add extern crate alloc; and use alloc::vec::Vec directly, while the binary that links the library can still depend on std for OS services.

#![no_std]

extern crate alloc;

use alloc::vec::Vec;

pub fn make_vec() -> Vec<u8> {
    let mut v = Vec::new();
    v.push(42);
    v
}

Most teams will keep their public API unchanged; the only migration step is adding the alloc dependency and updating imports.

How does MaybeUninit replace mem::uninitialized for safer uninitialized memory?

MaybeUninit is now stable and is the recommended way to work with uninitialized memory.

Unlike mem::uninitialized, which caused immediate undefined behavior if the value was ever read, MaybeUninit<T> tells the compiler that the inner T may be uninitialized, allowing gradual construction of complex data structures.

use std::mem::MaybeUninit;

let mut arr: [MaybeUninit; 4] = unsafe { MaybeUninit::uninit().assume_init() };
for i in 0..4 {
    arr[i] = MaybeUninit::new(i as u32);
}
let init_arr: [u32; 4] = unsafe { std::mem::transmute_copy(&arr) };

This matters if you need to avoid the overhead of default initialization for large buffers; the code remains sound as long as you only call .assume_init() after every element has been written.

What performance and usability improvements do the new HashMap and Cargo --offline bring?

Rust 1.36 swaps the standard HashMap implementation for the hashbrown-based version, delivering faster lookups and lower memory usage.

The public API stays the same, so existing code compiles without changes, but benchmarks show a typical 20-30 % speedup on insertion-heavy workloads. The default SipHash 1-3 algorithm is still used, preserving the security guarantees of the previous implementation.

On the tooling side, Cargo now supports a --offline flag. When invoked, Cargo resolves dependencies exclusively from the local cache, aborting if a crate is missing. This is useful for CI pipelines, air-gapped builds, or developers on long flights.

# Populate the cache before going offline
cargo fetch

# Build without network access
cargo build --offline

Most teams will add a pre-fetch step in their CI configuration to guarantee reproducible builds in restricted environments.

Frequently Asked Questions

Is the Future trait usable on stable Rust today?
Yes, you can import std::future::Future and implement or return it in stable code.

Do I need nightly to use the alloc crate in a no_std library?
No, alloc is stable and can be used in no_std libraries on the stable channel.

Can I still call mem::uninitialized in Rust 1.36?
You can, but it is slated for deprecation and MaybeUninit should be used instead.

Will existing HashMap code break after the upgrade?
No, the API is unchanged so code continues to compile without modifications.

How do I prepare a CI pipeline for Cargo --offline?
Run cargo fetch before the build step to ensure all dependencies are cached locally.

Does NLL back-port affect code written for the 2015 edition?
Yes, the borrow checker is now non-lexical for the 2015 edition, reducing false-positive borrow errors.

Releases In Branch 1.36

VersionRelease date
1.36.004 Jul 2019
(6 years ago)