]>
Commit | Line | Data |
---|---|---|
f9f354fc XL |
1 | error: future cannot be sent between threads safely |
2 | --> $DIR/issue-70818.rs:4:38 | |
3 | | | |
4 | LL | fn foo<T: Send, U>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send { | |
5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` | |
6 | LL | | |
7 | LL | async { (ty, ty1) } | |
8 | | ------------------- this returned value is of type `impl std::future::Future` | |
9 | | | |
10 | = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `U` | |
11 | note: captured value is not `Send` | |
12 | --> $DIR/issue-70818.rs:6:18 | |
13 | | | |
14 | LL | async { (ty, ty1) } | |
15 | | ^^^ has type `U` which is not `Send` | |
16 | = note: the return type of a function must have a statically known size | |
17 | help: consider restricting type parameter `U` | |
18 | | | |
19 | LL | fn foo<T: Send, U: std::marker::Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send { | |
20 | | ^^^^^^^^^^^^^^^^^^^ | |
21 | ||
22 | error: aborting due to previous error | |
23 |