]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-70818.stderr
Check opaque types satisfy their bounds
[rust.git] / src / test / ui / async-await / issue-70818.stderr
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 Future`
9    |
10 note: captured value is not `Send`
11   --> $DIR/issue-70818.rs:6:18
12    |
13 LL |     async { (ty, ty1) }
14    |                  ^^^ has type `U` which is not `Send`
15 help: consider restricting type parameter `U`
16    |
17 LL | fn foo<T: Send, U: Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send {
18    |                  ^^^^^^
19
20 error: aborting due to previous error
21