What’s new in the Rust programming language


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.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:



Source link

Leave a Comment

Your email address will not be published. Required fields are marked *