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