]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | error: future cannot be sent between threads safely |
2 | --> $DIR/issue-64130-4-async-move.rs:15:17 | |
3 | | | |
29967ef6 XL |
4 | LL | pub fn foo() -> impl Future + Send { |
5 | | ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` | |
60c5eb7d | 6 | | |
1b1a35ee | 7 | = help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)` |
60c5eb7d | 8 | note: future is not `Send` as this value is used across an await |
a2a8927a | 9 | --> $DIR/issue-64130-4-async-move.rs:21:31 |
60c5eb7d XL |
10 | | |
11 | LL | match client.status() { | |
ba9703b0 | 12 | | ------ has type `&Client` which is not `Send` |
60c5eb7d XL |
13 | LL | 200 => { |
14 | LL | let _x = get().await; | |
a2a8927a | 15 | | ^^^^^^ await occurs here, with `client` maybe used later |
60c5eb7d XL |
16 | ... |
17 | LL | } | |
18 | | - `client` is later dropped here | |
dfeec247 XL |
19 | help: consider moving this into a `let` binding to create a shorter lived borrow |
20 | --> $DIR/issue-64130-4-async-move.rs:19:15 | |
21 | | | |
22 | LL | match client.status() { | |
23 | | ^^^^^^^^^^^^^^^ | |
60c5eb7d XL |
24 | |
25 | error: aborting due to previous error | |
26 |