The unique approach of the Rust programming language results in better code with fewer compromises than C, C++, Go, and the other languages you probably use. It also gets updated regularly, often every month.

Where to download the latest Rust version

If you already have a previous version of Rust installed via rustup, you can access the latest version via the following command:

$ rustup update stable

The new features in Rust 1.58.1

This point release arriving January 20, 2022, just days after Rust 1.58, fixes a race condition in the std::fs::remove_dir_all standard library function. This vulnerability is tracked at CVE-2022-21658 and there was an advisory published. An attacker could use this security issue to trick a privileged program into deleting files and directories that the attacker otherwise could not access or delete. Rust versions 1.0 through 1.58 are affected by this vulnerability. Users are advised to update their toolchains and build programs with the updated compiler.

Rust 1.58.1 also addresses several regressions in diagnostics and tools introduced in Rust 1.58:

  • The non_send_fields_in_send_ty Clippy lint was found to have too many false positives and has been moved to the experimental lints group called “nursery”.
  • The useless_format Clippy lint was updated to handle captured identifiers in format strings, introduced in Rust 1.58.
  • A regression in Rustfmt preventing generated files from being formatted when passed through the standard input has been fixed.
  • An incorrect error message displayed by rustc in some cases has been fixed.

The new features in Rust 1.58

Rust 1.58, announced January 13, features captured identifiers in format strings. With this capability, format strings now can capture arguments by writing {ident} in the string. Formats long have accepted positional arguments and named arguments, such as:

println!("Hello, {}!", get_person());     // implicit position
println!("Hello, {0}!", get_person());     // explicit index
println!("Hello, {person}!", person = get_person());     // named

Now, named arguments also can be captured from the surrounding scope.

Also new in Rust 1.58: On Windows targets, std::process::Command will no longer search the current directory for executables, which was an effect of the historical behavior of the win32 CreateProcess API. This fixes a situation in which searches could lead to surprising behavior or malicious results when dealing with untrusted directories. 

Rust 1.58 also introduces more #[must_use] in the standard library. The #[must use] attribute can be applied to types or functions when failing to explicitly consider them or their output is almost certainly a bug. Rust 1.58 also has stabilized APIs such as Metadata::is_symlinkcode and Path::is_symlink.

The new features in Rust 1.57

Rust 1.57, unveiled December 2, brings panic! (for terminating a program in an unrecoverable state) to const contexts. Previously, the panic! macro was not usable in const fn and other compile-time contexts. This has now been stabilized. Together with the stabilization of panic!, several other standard libraries now are usable in const, such as assert!. But this stabilization does not yet include the full formatting infrastructure. The panic! macro must be called with either a static string or a single interpolated value to be used with {}. This support is expected to expand in the future.

Other new features and improvements in Rust 1.57:

  • Cargo adds support for arbitrarily named profiles.
  • try_reserve has been stabilized for Vec, String, HashMap, HashSet, and VecDeque. This API enables callers to fallibly allocate backing storage for these types.
  • Multiple other APIs have been stabilized including [T; N]::as_mut_slice and [T; N]::as_slice.
  • Macro attributes now may follow #derive and will see the original input.

The new features in Rust 1.56

Announced October 21, Rust 1.56 is the first version of the language that supports the Rust 2021 edition. The Rust 2021 edition lets Rust crate authors opt in to breaking language changes that make Rust easier to use and more consistent. Crates can opt in at any time and remain interoperable with crates in older editions. The Rust compiler supports all three editions of the language: 2015, 2018, and 2021.

Other new capabilities in Rust 1.56 include:

  • Disjoint capture in closures, to simplify the writing of closures.
  • Cargo.toml now supports a [package] [rust-version] field to specify the minimum supported Rust version for a crate, and Cargo will exit with an early error if that is not satisfied. While this currently does not influence the dependency resolver, the intent is catch compatibility problems before they turn into cryptic compiler errors.
  • New bindings in binding@pattern are supported. Rust pattern matching can be written with a single identifier that binds the entire value, followed by @ and a more-refined structural pattern, but has not allowed additional bindings in that pattern until now. This functionality had been permitted prior to Rust 1.0, but was removed due to unsoundness. The compiler team now has determined that this pattern is safe and allowable in stable Rust.
  • Panic macros now always expect format strings, just like printlin!().
  • A number of APIs have been stabilized including std::os::unix::fs::chroot and UnsafeCell::raw_get.

The new features in Rust 1.55

Announced September 9, 2021, Rust 1.55 offers faster, more correct float parsing. The standard library implementation of float parsing has been updated to use the Eisel-Lemire algorithm, which brings improvements in speed and correctness. Previously, certain edge cases failed to parse, but these have now been fixed.

Also in Rust 1.55:

  • The use of open ranges in patterns has been stabilized.
  • A number of methods and trait implementations have been stabilized including Bound::cloned and Drain::as_str.
  • Cargo now deduplicates compiler errors and prints a report at the end of compilation. Previously, when running cargo test, cargo check ---all targets, or similar commands that built the same Rust crate in multiple configurations, errors and warnings might show up duplicated as the rustc executions were run in parallel and showed the same warning.

The new features in Rust 1.54

Published July 29, Rust 1.54 supports invoking function-like macros inside attributes. Function-like macros can be macros based on macro-rules! or they can be procedural macros, which are invoked like macro!(…). A notable use case is including documentation from other files into Rust doc comments.

Other new features in Rust 1.54:

  • A number of instrinsics for wasm32 platform have been stabilized. These give access to SIMD instructions in WebAssembly.
  • Incremental compilation is re-enabled by default. It had been disabled by default in Rust 1.52.1. With Rust 1.52, additional validation was added when loading incremental compilation from on-disk cache, resulting in pre-existing potential soundness issues being uncovered as validation changed these silent bugs into internal compiler errors (ICE). Since then, work has been done to resolve these issues, with some fixes landing in Rust 1.53 and the majority landing in Rust 1.54. Remaining issues that could result in ICE are considered rare in practice.
  • Multiple methods and trait implementations have been stabilized.
  • Compiler output has been improved for debugging enums on Windows MSVC platforms for C++.

Rust 1.54 follows the June 17 release of Rust 1.53, which contained language and library features including the IntoIterator implementation for arrays.

The new features in Rust 1.52

Introduced May 6, Rust 1.52 was led by an enhancement to tooling support for Clippy, which is a collection of lints to find mistakes and improve Rust code. Previously, running cargo check followed by cargo clippy would not actually run Clippy, with the build caching in Cargo not differentiating between the two. This has been fixed in Rust 1.52. Also in version 1.52, the following methods were stabilized:

Several previously stable APIs, including char::len_utf8 and u8LLeq_ignore_ascii_case, are now const. For the compiler, the default LLVM has been upgraded to LLVM 12. A subsequent point release of the language, Rust 1.52.1, published May 10, provides a workaround for a bug in incremental compilation that was made into a compiler error in Rust 1.52.0. Rust builders recommend either an upgrade to 1.52.1 or disabling incremental compilation.

The new features in Rust 1.51.0

Published March 25, 2021, the Rust 1.51.0 release is one of the largest additions to the language and Cargo package manager in quite some time, with the stabilization of an MVP (minimum viable product) implementation of const generics and a new feature resolver for Cargo among the highlights. Other highlights:

  • With the const generics MVP, a tool is added for library designers in developing compile-time safe APIs. A highly anticipated feature, const generics are generic arguments that range over constant values, rather than types or lifetimes. This allows types to be parameterized by integers, for example. The plan is to introduce const generics gradually, so the only types that can be used as the type of a const generic argument currently are the types of integers, including size, usize, char, and bool.
  • Along with const generics, a new API has been stabilized that uses it, std::array::IntoIter, which allows developers to create a by value iterator over any array.
  • For Cargo, the new feature resolver introduces an algorithm for computing package features to help avoid some unwanted unification with the current resolver.
  • Improved compile times on MacOS, with improvements to speed up builds that include debug info and reduce the amount of disk space used.
  • Items such as functions, traits, and structs can be parameterized by constant values in addition to types and lifetimes.
  • Stabilized APIs, including stabilization of 18 new methods for types such as slice and Peekable.

The new features in Rust 1.50.0

Published February 11, 2021, Rust 1.50.0 improves array indexing, expands safe access to union fields, and adds to the standard library. Specific improvements include:

  • For const-generic array indexing, this release continues a progression toward stable const generics, adding implementations of ops::Index and IndexMut for arrays [T; N] for any length of Const N. The indexing operator [ ] already worked on arrays through the compiler, but at the type level, arrays did not actually implement the library traits until now. Also, stable use of const values in array repetition is formally acknowledged.
  • Safe assignments to ManuallyDrop<T> union fields are permitted.
  • A niche for File on Unix platforms is now permitted. With this feature, some types in Rust have limitations on what is considered a valid value, which may not cover the range of possible memory values. Any remaining valid value is called a niche, with this space usable for type layout optimizations. On Unix platforms, Rust’s File is made of the system’s file integer descriptor; this happens to have a possible niche because it cannot be -1! System calls that return a file descriptor use -1 to indicate an error occurred, so it is never possible for -1 to be a real file descriptor. Beginning with Rust 1.50, this is added to the type definition so it can be used in layout optimizations, too. It follows that Option<File> now will have the same size as File.
  • For Cargo, a [rustc-workspace-wrapper] option has been added, to set a wrapper to execute instead of rustc, for workspace members only. Also, the --workspace flag has been added to the cargo update command.
  • Nine new stable functions were added to the library: bool::then, btree_map::Entry::or_insert_with_key, f32::clamp, f64::clamphash_map::Entry::or_insert_with_key, Ord::clamp, RefCell::take, slice::fill, and UnsafeCell::get_mut.
  • Also in the library, several existing functions were made const: IpAddr::is_ipv4, IpAddr::is_ipv6, Layout::size, Layout::align, Layout::from_size_align, pow for all integer types, checked_pow for all integer types, saturating_pow for all integer types, wrapping_pow for all integer types, next_power_of_two for all unsigned integer types, and checked_power_of_two for all unsigned integer types.

The new features in Rust 1.49.0

Announced December 31, 2020, Rust 1.49.0 designates 64-bit Arm Linux as a Tier 1 target, thus providing the highest support guarantee, with the full test suite run on this platform on every change merged in the compiler. This support is expected to benefit workloads spanning from embedded systems to servers and desktops. Prebuilt binaries also are available. This marks the first time a non-x86 target has reached Tier 1 support. The Rust development team hopes to bring more platforms into this tier in the future.

Source