]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr
Rollup merge of #106960 - estebank:parse-anon-enums, r=cjgillot
[rust.git] / tests / ui / async-await / issue-64130-4-async-move.no_drop_tracking.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/issue-64130-4-async-move.rs:19:17
3    |
4 LL | pub fn foo() -> impl Future + Send {
5    |                 ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
6    |
7    = help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
8 note: future is not `Send` as this value is used across an await
9   --> $DIR/issue-64130-4-async-move.rs:25:31
10    |
11 LL |         match client.status() {
12    |               ------ has type `&Client` which is not `Send`
13 LL |             200 => {
14 LL |                 let _x = get().await;
15    |                               ^^^^^^ await occurs here, with `client` maybe used later
16 ...
17 LL |     }
18    |     - `client` is later dropped here
19 help: consider moving this into a `let` binding to create a shorter lived borrow
20   --> $DIR/issue-64130-4-async-move.rs:23:15
21    |
22 LL |         match client.status() {
23    |               ^^^^^^^^^^^^^^^
24
25 error: aborting due to previous error
26