2019-10-06 17:14:34 -05:00
|
|
|
error: future cannot be sent between threads safely
|
2023-01-25 21:51:26 -06:00
|
|
|
--> $DIR/issue-64130-4-async-move.rs:21:17
|
2019-10-06 17:14:34 -05:00
|
|
|
|
|
2022-02-11 01:18:06 -06:00
|
|
|
LL | pub fn foo() -> impl Future + Send {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
2019-10-06 17:14:34 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
|
2019-10-31 09:36:41 -05:00
|
|
|
note: future is not `Send` as this value is used across an await
|
2022-10-01 05:19:31 -05:00
|
|
|
--> $DIR/issue-64130-4-async-move.rs:27:31
|
2019-10-06 17:14:34 -05:00
|
|
|
|
|
|
|
|
LL | match client.status() {
|
2020-04-08 13:54:31 -05:00
|
|
|
| ------ has type `&Client` which is not `Send`
|
2019-10-06 17:14:34 -05:00
|
|
|
LL | 200 => {
|
|
|
|
LL | let _x = get().await;
|
2021-11-15 18:57:53 -06:00
|
|
|
| ^^^^^^ await occurs here, with `client` maybe used later
|
2019-10-06 17:14:34 -05:00
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - `client` is later dropped here
|
2020-01-18 22:59:59 -06:00
|
|
|
help: consider moving this into a `let` binding to create a shorter lived borrow
|
2022-10-01 05:19:31 -05:00
|
|
|
--> $DIR/issue-64130-4-async-move.rs:25:15
|
2020-01-14 07:22:43 -06:00
|
|
|
|
|
|
|
|
LL | match client.status() {
|
|
|
|
| ^^^^^^^^^^^^^^^
|
2019-10-06 17:14:34 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|