diff options
Diffstat (limited to 'src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr')
-rw-r--r-- | src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index 77cef485f..34ff59a9b 100644 --- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -78,20 +78,21 @@ LL | impl<P: Deref<Target: Unpin>> Pin<P> { error[E0308]: mismatched types --> $DIR/expected-boxed-future-isnt-pinned.rs:28:5 | -LL | fn zap() -> BoxFuture<'static, i32> { - | ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type LL | / async { LL | | 42 LL | | } - | |_____^ expected struct `Pin`, found opaque type - | - ::: $SRC_DIR/core/src/future/mod.rs:LL:COL - | -LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return> - | ------------------------------- the found opaque type - | - = note: expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` - found opaque type `impl Future<Output = {integer}>` + | | ^ + | | | + | |_____expected struct `Pin`, found `async` block + | arguments to this function are incorrect + | + = note: expected struct `Pin<Box<dyn Future<Output = i32> + Send>>` + found `async` block `[async block@$DIR/expected-boxed-future-isnt-pinned.rs:28:5: 30:6]` +note: function defined here + --> $SRC_DIR/core/src/future/mod.rs:LL:COL + | +LL | pub const fn identity_future<O, Fut: Future<Output = O>>(f: Fut) -> Fut { + | ^^^^^^^^^^^^^^^ help: you need to pin and box this expression | LL ~ Box::pin(async { |