RS.CLIPPY.ASYNC_YIELDS_ASYNC
Async blocks that return a type that can be awaited
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: async_yields_async. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for async blocks that yield values of types that can themselves be awaited.
Why is this bad?
An await is likely missing.
Example
async fn foo() {}
fn bar() {
let x = async {
foo()
};
}
Use instead:
async fn foo() {}
fn bar() {
let x = async {
foo().await
};
}