Reading issue
rust-lang / rust · Issue No. 163137
fn main() {
handler(async {});
}
fn handler(_f: impl AsyncFnOnce()) {}
error[E0277]: the trait bound `{async block@src/main.rs:2:13: 2:18}: AsyncFnOnce()` is not satisfied
--> src/main.rs:2:13
|
2 | handler(async {});
| ------- ^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{async block@src/main.rs:2:13: 2:18}`
| |
| required by a bound introduced by this call
|
note: required by a bound in `handler`
--> src/main.rs:5:21
|
5 | fn handler(_f: impl AsyncFnOnce()) {}
| ^^^^^^^^^^^^^ required by this bound in `handler`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` (bin "playground") due to 1 previous error
error[E0277]: the trait bound `{async block@src/main.rs:2:13: 2:18}: AsyncFnOnce()` is not satisfied
--> src/main.rs:2:13
|
2 | handler(async {});
| ------- ^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{async block@src/main.rs:2:13: 2:18}`
| |
| required by a bound introduced by this call
|
= help: the trait `AsyncFnOnce()` is not implemented for `()`
= note: wrap the `()` in a closure with no arguments: `async || { /* code */ }`note: required by a bound in `handler`
--> src/main.rs:5:21
|
5 | fn handler(_f: impl AsyncFnOnce()) {}
| ^^^^^^^^^^^^^ required by this bound in `handler`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` (bin "playground") due to 1 previous error
The additional note and help text are already present for the non-async function counterparts (FnOnce, and others). This issue refers to all AsyncFn variants.
Rust playground: 1.100.0-nightly (2026-09-20 bba531001d4de6d7f496)
Playground with an example of both async and non-async code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=84d4f70ed2b310bc5fbc4f39aa63dba5
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.