Invalid suggestion for AsyncFnOnce
trait object #134182
Open
Description
opened on Dec 11, 2024
Code
#![feature(async_closure)]
pub fn f(x: &dyn AsyncFnOnce()) {}
Current output
error[E0191]: the value of the associated type `CallOnceFuture` in `AsyncFnOnce` must be specified
--> src/main.rs:3:18
|
3 | pub fn f(x: &dyn AsyncFnOnce()) {}
| ^^^^^^^^^^^^^ help: specify the associated type: `AsyncFnOnce()<CallOnceFuture = Type>`
Desired output
???
Rationale and extra context
The suggested replacement pub fn f(x: &dyn AsyncFnOnce()<CallOnceFuture = Type>) {}
is not valid syntax.
Since dyn Async*
is not supported, perhaps it should just say that? I don't know what the plans are here.
Other cases
Rust Version
rustc 1.85.0-nightly (a224f3807 2024-12-09)
binary: rustc
commit-hash: a224f3807e58afc9353510f1d556c607d367545d
commit-date: 2024-12-09
host: aarch64-apple-darwin
release: 1.85.0-nightly
LLVM version: 19.1.5
Anything else?
No response
Activity