]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-98634.stderr
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / async-await / issue-98634.stderr
1 error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
2   --> $DIR/issue-98634.rs:45:23
3    |
4 LL |         StructAsync { callback }.await;
5    |                       ^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
6    |
7    = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
8            found opaque type `impl Future<Output = ()>`
9 note: required by a bound in `StructAsync`
10   --> $DIR/issue-98634.rs:9:35
11    |
12 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
13    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
14
15 error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
16   --> $DIR/issue-98634.rs:45:9
17    |
18 LL |         StructAsync { callback }.await;
19    |         ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
20    |
21    = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
22            found opaque type `impl Future<Output = ()>`
23 note: required by a bound in `StructAsync`
24   --> $DIR/issue-98634.rs:9:35
25    |
26 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
27    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
28
29 error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
30   --> $DIR/issue-98634.rs:45:33
31    |
32 LL |         StructAsync { callback }.await;
33    |                                 ^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
34    |
35    = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
36            found opaque type `impl Future<Output = ()>`
37 note: required by a bound in `StructAsync`
38   --> $DIR/issue-98634.rs:9:35
39    |
40 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
41    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
42
43 error: aborting due to 3 previous errors
44
45 For more information about this error, try `rustc --explain E0271`.