aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/send-not-implemented.stderr
blob: 05c445b9e20a210e526f873cd494ddee9d24e972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
error: future cannot be sent between threads safely
  --> $DIR/send-not-implemented.rs:8:26
   |
8  |       async fn test(&self) {
   |  __________________________^
9  | |         let mutex = Mutex::new(());
10 | |         let _guard = mutex.lock().unwrap();
11 | |         f().await;
12 | |     }
   | |_____^ future returned by `__test` is not `Send`
   |
   = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`
note: future is not `Send` as this value is used across an await
  --> $DIR/send-not-implemented.rs:11:9
   |
10 |         let _guard = mutex.lock().unwrap();
   |             ------ has type `MutexGuard<'_, ()>` which is not `Send`
11 |         f().await;
   |         ^^^^^^^^^ await occurs here, with `_guard` maybe used later
12 |     }
   |     - `_guard` is later dropped here
   = note: required for the cast to the object type `dyn Future<Output = ()> + Send`