help: you need to pin and box this expression
|
LL | Box::pin(x)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
- --> $DIR/expected-boxed-future-isnt-pinned.rs:18:5
+ --> $DIR/expected-boxed-future-isnt-pinned.rs:15:5
|
LL | fn bar<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
| ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type
help: store this in the heap by calling `Box::new`
|
LL | Pin::new(Box::new(x))
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned
--> $DIR/expected-boxed-future-isnt-pinned.rs:22:5
found opaque type `impl Future`
help: you need to pin and box this expression
|
-LL | Box::pin(async {
+LL ~ Box::pin(async {
LL | 42
-LL | })
+LL ~ })
|
error: aborting due to 6 previous errors