1 error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
2 --> $DIR/issue-98634.rs:45:23
4 LL | StructAsync { callback }.await;
5 | ^^^^^^^^ expected struct `Pin`, found opaque type
7 note: while checking the return type of the `async fn`
8 --> $DIR/issue-98634.rs:24:21
10 LL | async fn callback() {}
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 by a bound in `StructAsync`
15 --> $DIR/issue-98634.rs:9:35
17 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
18 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
20 error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
21 --> $DIR/issue-98634.rs:45:9
23 LL | StructAsync { callback }.await;
24 | ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type
26 note: while checking the return type of the `async fn`
27 --> $DIR/issue-98634.rs:24:21
29 LL | async fn callback() {}
30 | ^ checked the `Output` of this `async fn`, found opaque type
31 = note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
32 found opaque type `impl Future<Output = ()>`
33 note: required by a bound in `StructAsync`
34 --> $DIR/issue-98634.rs:9:35
36 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
39 error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
40 --> $DIR/issue-98634.rs:45:33
42 LL | StructAsync { callback }.await;
43 | ^^^^^^ expected struct `Pin`, found opaque type
45 note: while checking the return type of the `async fn`
46 --> $DIR/issue-98634.rs:24:21
48 LL | async fn callback() {}
49 | ^ checked the `Output` of this `async fn`, found opaque type
50 = note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
51 found opaque type `impl Future<Output = ()>`
52 note: required by a bound in `StructAsync`
53 --> $DIR/issue-98634.rs:9:35
55 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
58 error: aborting due to 3 previous errors
60 For more information about this error, try `rustc --explain E0271`.