Chapter 5. Changes in Rust 1.66.1 Toolset
Rust Toolset has been updated from version 1.62.1 to 1.66.1 on RHEL 7, RHEL 8, and RHEL 9.
Notable changes include:
-
The
thread::scope
API creates a lexical scope in which local variables can be safely borrowed by newly spawned threads, and those threads are all guaranteed to exit before the scope ends. -
The
hint::black_box
API adds a barrier to compiler optimization, which is useful for preserving behavior in benchmarks that might otherwise be optimized away. -
The
.await
keyword now makes conversions with theIntoFuture
trait, similar to the relationship betweenfor
andIntoIterator
. - Generic associated types (GATs) allow traits to include type aliases with generic parameters, enabling new abstractions over both types and lifetimes.
-
A new
let
-else
statement allows binding local variables with conditional pattern matching, executing a divergentelse
block when the pattern does not match. -
Labeled blocks allow
break
statements to jump to the end of the block, optionally including an expression value. -
rust-analyzer
is a new implementation of the Language Server Protocol, enabling Rust support in many editors. This replaces the formerrls
package, but you might need to adjust your editor configuration to migrate torust-analyzer
. -
Cargo has a new
cargo remove
subcommand for removing dependencies fromCargo.toml
.
For detailed information regarding the updates, see the series of upstream release announcements: