aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/send-not-implemented.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/send-not-implemented.stderr')
-rw-r--r--tests/ui/send-not-implemented.stderr27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/ui/send-not-implemented.stderr b/tests/ui/send-not-implemented.stderr
index 05c445b..473a31b 100644
--- a/tests/ui/send-not-implemented.stderr
+++ b/tests/ui/send-not-implemented.stderr
@@ -7,7 +7,7 @@ error: future cannot be sent between threads safely
10 | | let _guard = mutex.lock().unwrap();
11 | | f().await;
12 | | }
- | |_____^ future returned by `__test` is not `Send`
+ | |_____^ future created by async block 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
@@ -20,3 +20,28 @@ note: future is not `Send` as this value is used across an await
12 | }
| - `_guard` is later dropped here
= note: required for the cast to the object type `dyn Future<Output = ()> + Send`
+
+error: future cannot be sent between threads safely
+ --> $DIR/send-not-implemented.rs:14:38
+ |
+14 | async fn test_ret(&self) -> bool {
+ | ______________________________________^
+15 | | let mutex = Mutex::new(());
+16 | | let _guard = mutex.lock().unwrap();
+17 | | f().await;
+18 | | true
+19 | | }
+ | |_____^ future created by async block 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:17:9
+ |
+16 | let _guard = mutex.lock().unwrap();
+ | ------ has type `MutexGuard<'_, ()>` which is not `Send`
+17 | f().await;
+ | ^^^^^^^^^ await occurs here, with `_guard` maybe used later
+18 | true
+19 | }
+ | - `_guard` is later dropped here
+ = note: required for the cast to the object type `dyn Future<Output = bool> + Send`