1error: future cannot be sent between threads safely 2 --> tests/ui/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 `{async block@$DIR/tests/ui/send-not-implemented.rs:8:26: 12:6}`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`, which is required by `{async block@$DIR/tests/ui/send-not-implemented.rs:8:26: 12:6}: Send` 13note: future is not `Send` as this value is used across an await 14 --> tests/ui/send-not-implemented.rs:11:13 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 20 = note: required for the cast from `Pin<Box<{async block@$DIR/tests/ui/send-not-implemented.rs:8:26: 12:6}>>` to `Pin<Box<dyn Future<Output = ()> + Send>>` 21 22error: future cannot be sent between threads safely 23 --> tests/ui/send-not-implemented.rs:14:38 24 | 2514 | async fn test_ret(&self) -> bool { 26 | ______________________________________^ 2715 | | let mutex = Mutex::new(()); 2816 | | let _guard = mutex.lock().unwrap(); 2917 | | f().await; 3018 | | true 3119 | | } 32 | |_____^ future created by async block is not `Send` 33 | 34 = help: within `{async block@$DIR/tests/ui/send-not-implemented.rs:14:38: 19:6}`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`, which is required by `{async block@$DIR/tests/ui/send-not-implemented.rs:14:38: 19:6}: Send` 35note: future is not `Send` as this value is used across an await 36 --> tests/ui/send-not-implemented.rs:17:13 37 | 3816 | let _guard = mutex.lock().unwrap(); 39 | ------ has type `MutexGuard<'_, ()>` which is not `Send` 4017 | f().await; 41 | ^^^^^ await occurs here, with `_guard` maybe used later 42 = note: required for the cast from `Pin<Box<{async block@$DIR/tests/ui/send-not-implemented.rs:14:38: 19:6}>>` to `Pin<Box<dyn Future<Output = bool> + Send>>` 43