With Rust 1.88, the cfg
predicate language now backs Boolean literals, true
and false
, acting as a configuration that is always enabled or disabled. This works in Rust conditional compilation with cfg
and cfg_attr
attributes, in the built-in cfg!
macro, and in Cargo [target]
tables in both configuration and manifests, the Rust team said. Previously, empty predicate lists could be used for unconditional configuration, like cfg(all())
for enabled and cfg(any())
for disabled, but cfg(true)
and cfg(false)
offer a more direct way to say what is meant, the team said.
Also with Rust 1.88, let
statements now can be chained (&&
) inside if
and while
conditions, and even intermingle with Boolean expressions. Thusly, there is less distinction between if
and if let
and between while
and while let
. The patterns inside the let
sub-expressions can be refutable or irrefutable, and bindings are usable in later parts of the chain as well as the body, according to the Rust team.
Finally, the Cargo package manager now automatically runs garbage collection on the cache in its home directory. In explaining this change, the Rust team said that when building, Cargo downloads and caches crates needed as dependencies. Historically, these downloaded files were never cleaned up, leading to an unbounded amount of disk usage in Cargo’s home directory. With Rust 1.88, Cargo introduces a garbage collection mechanism to automatically clean up old files.