]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-64130-4-async-move.stderr
update async-await send/sync test
[rust.git] / src / test / ui / async-await / issue-64130-4-async-move.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/issue-64130-4-async-move.rs:15:17
3    |
4 LL | pub fn foo() -> impl Future + Send {
5    |                 ^^^^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
6    |
7    = help: the trait `std::marker::Sync` is not implemented for `(dyn std::any::Any + std::marker::Send + 'static)`
8 note: future is not `Send` as this value is used across an await
9   --> $DIR/issue-64130-4-async-move.rs:21:26
10    |
11 LL |         match client.status() {
12    |               ------ has type `&Client`
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 method call 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    |               ^^^^^^^^^^^^^^^
24    = note: the return type of a function must have a statically known size
25
26 error: aborting due to previous error
27