]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-64130-non-send-future-diags.stderr
Auto merge of #83152 - guswynn:jemallocator_part2, r=Mark-Simulacrum
[rust.git] / src / test / ui / async-await / issue-64130-non-send-future-diags.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/issue-64130-non-send-future-diags.rs:21:5
3    |
4 LL | fn is_send<T: Send>(t: T) { }
5    |               ---- required by this bound in `is_send`
6 ...
7 LL |     is_send(foo());
8    |     ^^^^^^^ future returned by `foo` is not `Send`
9    |
10    = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, u32>`
11 note: future is not `Send` as this value is used across an await
12   --> $DIR/issue-64130-non-send-future-diags.rs:15:5
13    |
14 LL |     let g = x.lock().unwrap();
15    |         - has type `MutexGuard<'_, u32>` which is not `Send`
16 LL |     baz().await;
17    |     ^^^^^^^^^^^ await occurs here, with `g` maybe used later
18 LL | }
19    | - `g` is later dropped here
20
21 error: aborting due to previous error
22