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