]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/async-await/issue-98634.stderr
Rollup merge of #105641 - Amanieu:btree_cursor, r=m-ou-se
[rust.git] / tests / ui / async-await / issue-98634.stderr
index 85fa04446cccf51903ced200b4c466bac7386308..4c5dfeed9ba5c6e87992d40a0b9bb8350e9f56b3 100644 (file)
@@ -1,14 +1,9 @@
-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 = ()>`
+error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
   --> $DIR/issue-98634.rs:45:23
    |
 LL |         StructAsync { callback }.await;
    |                       ^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
    |
-note: while checking the return type of the `async fn`
-  --> $DIR/issue-98634.rs:24:21
-   |
-LL | async fn callback() {}
-   |                     ^ checked the `Output` of this `async fn`, found opaque type
    = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
            found opaque type `impl Future<Output = ()>`
 note: required by a bound in `StructAsync`
@@ -17,17 +12,12 @@ note: required by a bound in `StructAsync`
 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
 
-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 = ()>`
+error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
   --> $DIR/issue-98634.rs:45:9
    |
 LL |         StructAsync { callback }.await;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
    |
-note: while checking the return type of the `async fn`
-  --> $DIR/issue-98634.rs:24:21
-   |
-LL | async fn callback() {}
-   |                     ^ checked the `Output` of this `async fn`, found opaque type
    = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
            found opaque type `impl Future<Output = ()>`
 note: required by a bound in `StructAsync`
@@ -36,17 +26,12 @@ note: required by a bound in `StructAsync`
 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
 
-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 = ()>`
+error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
   --> $DIR/issue-98634.rs:45:33
    |
 LL |         StructAsync { callback }.await;
    |                                 ^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
    |
-note: while checking the return type of the `async fn`
-  --> $DIR/issue-98634.rs:24:21
-   |
-LL | async fn callback() {}
-   |                     ^ checked the `Output` of this `async fn`, found opaque type
    = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
            found opaque type `impl Future<Output = ()>`
 note: required by a bound in `StructAsync`