Rust 1.46 Released

Rust 1.46 enables a bunch of new things to appear in const fn and two new standard library APIs.

The Rust team announced the latest version 1.46 of Rust programming language, which enables a bunch of new things to appear in const fn, two new standard library APIs, and a new feature useful for library authors.
 
 
Source: rust-lang.org
 
if, match, and loop expressions can now be used in const functions and you can now also coerce and cast to slices (&[T]). This will add a lot of compile-time computation power.
 
With the release of 1.46.0, the #[track_caller] attribute can now be added to functions. This will enable you to use the function's caller's location information for panic messages. Now, you no longer need parentheses for recursively indexing. E.g. x.0.0 over (x.0).0.
 
std::mem::forget is now a const fn. And, two new APIs have been stabilized in this release: Option::zip and vec::Drain::as_slice
 
To learn more you can visit the release notes here.


Next Recommended Reading Rust 1.34.1 Released