about summary refs log tree commit diff
path: root/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr')
-rw-r--r--tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr
new file mode 100644
index 00000000000..1033fa6cc8b
--- /dev/null
+++ b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr
@@ -0,0 +1,32 @@
+error: future cannot be sent between threads safely
+  --> $DIR/issue-65436-raw-ptr-not-send.rs:16:17
+   |
+LL |       assert_send(async {
+   |  _________________^
+LL | |
+LL | |         bar(Foo(std::ptr::null())).await;
+LL | |     })
+   | |_____^ future created by async block is not `Send`
+   |
+   = help: within `[async block@$DIR/issue-65436-raw-ptr-not-send.rs:16:17: 19:6]`, the trait `Send` is not implemented for `*const u8`
+note: future is not `Send` as this value is used across an await
+  --> $DIR/issue-65436-raw-ptr-not-send.rs:18:35
+   |
+LL |         bar(Foo(std::ptr::null())).await;
+   |                 ----------------  ^^^^^^- `std::ptr::null()` is later dropped here
+   |                 |                 |
+   |                 |                 await occurs here, with `std::ptr::null()` maybe used later
+   |                 has type `*const u8` which is not `Send`
+help: consider moving this into a `let` binding to create a shorter lived borrow
+  --> $DIR/issue-65436-raw-ptr-not-send.rs:18:13
+   |
+LL |         bar(Foo(std::ptr::null())).await;
+   |             ^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `assert_send`
+  --> $DIR/issue-65436-raw-ptr-not-send.rs:13:19
+   |
+LL | fn assert_send<T: Send>(_: T) {}
+   |                   ^^^^ required by this bound in `assert_send`
+
+error: aborting due to previous error
+