@@ -22,20 +22,26 @@ note: future is not `Send` as this value is used across an await
2222 = note: required for the cast to the object type `dyn Future<Output = ()> + Send`
2323
2424error: future cannot be sent between threads safely
25- --> $DIR/send-not-implemented.rs:14:33
25+ --> $DIR/send-not-implemented.rs:14:38
2626 |
27- 14 | async fn test_ret(&self) -> bool {
28- | ^^^^ future created by async block is not `Send`
27+ 14 | async fn test_ret(&self) -> bool {
28+ | ______________________________________^
29+ 15 | | let mutex = Mutex::new(());
30+ 16 | | let _guard = mutex.lock().unwrap();
31+ 17 | | f().await;
32+ 18 | | true
33+ 19 | | }
34+ | |_____^ future created by async block is not `Send`
2935 |
3036 = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`
3137note: future is not `Send` as this value is used across an await
3238 --> $DIR/send-not-implemented.rs:17:9
3339 |
34- 14 | async fn test_ret(&self) -> bool {
35- | - `_guard` is later dropped here
36- 15 | let mutex = Mutex::new(());
374016 | let _guard = mutex.lock().unwrap();
3841 | ------ has type `MutexGuard<'_, ()>` which is not `Send`
394217 | f().await;
4043 | ^^^^^^^^^ await occurs here, with `_guard` maybe used later
44+ 18 | true
45+ 19 | }
46+ | - `_guard` is later dropped here
4147 = note: required for the cast to the object type `dyn Future<Output = bool> + Send`
0 commit comments