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