Rust 1.34 (2019-04-11)

Announce

The Rust team is happy to announce a new version of Rust, 1.34.0.

Rust is a programming language that is empowering everyone to build reliable and efficient software.

If you have a previous version of Rust installed via rustup, getting Rust 1.34.0 is as easy as:

$ rustup update stable

If you don’t have it already, you can get rustup from the appropriate page on our website.

What’s in 1.34.0 stable

The largest feature in this release is the introduction of alternative cargo registries.

The release also includes support for ? in documentation tests, some improvements for #[attribute(..)]s, as well as the stabilization of TryFrom.

Read on for a few highlights, or see the detailed release notes for additional information.

Alternative cargo registries

Since before 1.0, Rust has had a public crate registry, crates.io.

People publish crates with cargo publish and it’s easy to include these crates in the [dependencies] section of your Cargo.toml.

However, not everyone wants to publish their crates to crates.io.

People maintaining proprietary/closed-source code cannot use crates.io, and instead are forced to use git or path dependencies. This is usually fine for small projects, but if you have a lot of closed-source crates within a large organization, you lose the benefit of the versioning support that crates.io has.

With this release, Cargo gains support for alternate registries.

These registries coexist with crates.io, so you can write software that depends on crates from both crates.io and your custom registry. Crates on crates.io cannot however depend on external registries.

To use an alternate registry, you must add these lines to your .cargo/config. This file can be in your home directory (~/.cargo/config) or relative to the package directory:

[registries]
my-registry = { index = "https://my-intranet:8080/git/index" }