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)`
2021-09-14 10:44:08 -05:00
= note: consider using `std::sync::Arc<(dyn Any + Send + 'static)>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
2019-10-31 09:36:41 -05:00
note: future is not `Send` as this value is used across an await
2023-06-12 03:55:36 -05:00
--> $DIR/issue-64130-4-async-move.rs:27:23
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 => {
2023-06-12 03:55:36 -05:00
LL | get().await;
| ^^^^^ 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