]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-98604.stderr
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / type-alias-impl-trait / issue-98604.stderr
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
3    |
4 LL |     Box::new(test) as AsyncFnPtr;
5    |     ^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type
6    |
7 note: while checking the return type of the `async fn`
8   --> $DIR/issue-98604.rs:5:17
9    |
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)>>`
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0271`.