Series: The Rust Annals
Vol. I Issue 68 nlopes.dev
Announcing Rust 1.67.0
Rust 1.67 makes #[must_use] effective on async function outputs and replaces the standard library’s channel implementation, fixing bugs and improving performance. It also stabilizes integer APIs and makes character conversions available in const contexts.
Unused async outputs now trigger must-use warnings
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]. 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 now warns if that output is unused:
#[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
Standard channels gain a new implementation
Rust’s standard library has had a multi-producer, single-consumer channel since before 1.0. In this release, the std::sync::mpsc implementation is switched to one based on crossbeam-channel.
This channel update contains no API changes, but 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.
Integer APIs stabilize; character conversions become const
The integer and nonzero-integer entries in the API list are newly stable. The five character-conversion entries are existing APIs now stable in const contexts.