1error: future cannot be sent between threads safely
2  --> $DIR/send-not-implemented.rs:8:26
3   |
48  |       async fn test(&self) {
5   |  __________________________^
69  | |         let mutex = Mutex::new(());
710 | |         let _guard = mutex.lock().unwrap();
811 | |         f().await;
912 | |     }
10   | |_____^ future created by async block is not `Send`
11   |
12   = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`
13note: future is not `Send` as this value is used across an await
14  --> $DIR/send-not-implemented.rs:11:9
15   |
1610 |         let _guard = mutex.lock().unwrap();
17   |             ------ has type `MutexGuard<'_, ()>` which is not `Send`
1811 |         f().await;
19   |         ^^^^^^^^^ await occurs here, with `_guard` maybe used later
2012 |     }
21   |     - `_guard` is later dropped here
22   = note: required for the cast to the object type `dyn Future<Output = ()> + Send`
23
24error: future cannot be sent between threads safely
25  --> $DIR/send-not-implemented.rs:14:38
26   |
2714 |       async fn test_ret(&self) -> bool {
28   |  ______________________________________^
2915 | |         let mutex = Mutex::new(());
3016 | |         let _guard = mutex.lock().unwrap();
3117 | |         f().await;
3218 | |         true
3319 | |     }
34   | |_____^ future created by async block is not `Send`
35   |
36   = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`
37note: future is not `Send` as this value is used across an await
38  --> $DIR/send-not-implemented.rs:17:9
39   |
4016 |         let _guard = mutex.lock().unwrap();
41   |             ------ has type `MutexGuard<'_, ()>` which is not `Send`
4217 |         f().await;
43   |         ^^^^^^^^^ await occurs here, with `_guard` maybe used later
4418 |         true
4519 |     }
46   |     - `_guard` is later dropped here
47   = note: required for the cast to the object type `dyn Future<Output = bool> + Send`
48