fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
911 B22 linesraw
1error: future cannot be sent between threads safely
2  --> $DIR/issue-71137.rs:22:14
3   |
4LL |   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>`
8note: future is not `Send` as this value is used across an await
9  --> $DIR/issue-71137.rs:14:26
10   |
11LL |     let mut guard = m.lock().unwrap();
12   |         --------- has type `MutexGuard<'_, i32>` which is not `Send`
13LL |     (async { "right"; }).await;
14   |                          ^^^^^ await occurs here, with `mut guard` maybe used later
15note: required by a bound in `fake_spawn`
16  --> $DIR/issue-71137.rs:8:27
17   |
18LL | fn fake_spawn<F: Future + Send + 'static>(f: F) { }
19   |                           ^^^^ required by this bound in `fake_spawn`
20
21error: aborting due to previous error
22