Series: The Rust Annals
Vol. I Issue 68 nlopes.dev
Announcing Rust 1.67.0
Stabilization of integer logarithm methods and correction of #[must_use] behavior on async functions provide meaningful standard library and compiler consistency improvements.
If you’d like to help us out by testing future releases, you might consider
updating locally to use the beta channel (rustup default beta) or the nightly
channel (rustup default nightly). Please
report any bugs you
might come across!
#[must_use] effective on async fn
async functions annotated with #[must_use] now apply that attribute to the
output of the returned impl Future. The Future trait itself is already
annotated with #[must_use], so all types implementing Future are
automatically #[must_use], which meant that previously there was no way to
indicate that the output of the Future is itself significant and should be used in some way.
With 1.67, the compiler will now warn if the output isn’t used in some way.
#[must_use]
async fn bar() -> u32 { 0 }
async fn caller() {
bar().await;
}
warning: unused output of future returned by `bar` that must be used
--> src/lib.rs:5:5
|
5 | bar().await;
| ^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
std::sync::mpsc implementation updated
Rust’s standard library has had a multi-producer, single-consumer channel since
before 1.0, but in this release the implementation is switched out to be based
on crossbeam-channel. This
release contains no API changes, but the new implementation fixes a number of
bugs and improves the performance and maintainability of the implementation.
Users should not notice any significant changes in behavior as of this release.