1 error[E0271]: expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
2 --> $DIR/issue-98604.rs:9:5
4 LL | Box::new(test) as AsyncFnPtr;
5 | ^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type
7 note: while checking the return type of the `async fn`
8 --> $DIR/issue-98604.rs:5:17
10 LL | async fn test() {}
11 | ^ checked the `Output` of this `async fn`, found opaque type
12 = note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
13 found opaque type `impl Future<Output = ()>`
14 = note: required for the cast from `fn() -> impl Future<Output = ()> {test}` to the object type `dyn Fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>>`
16 error: aborting due to previous error
18 For more information about this error, try `rustc --explain E0271`.