diff options
Diffstat (limited to 'src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr')
-rw-r--r-- | src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr new file mode 100644 index 000000000..b23093001 --- /dev/null +++ b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr @@ -0,0 +1,32 @@ +error: future cannot be sent between threads safely + --> $DIR/issue-65436-raw-ptr-not-send.rs:12:5 + | +LL | assert_send(async { + | ^^^^^^^^^^^ future created by async block is not `Send` + | + = help: within `impl Future<Output = ()>`, 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:14:35 + | +LL | bar(Foo(std::ptr::null())).await; + | ---------------- ^^^^^^ await occurs here, with `std::ptr::null()` maybe used later + | | + | has type `*const u8` which is not `Send` +note: `std::ptr::null()` is later dropped here + --> $DIR/issue-65436-raw-ptr-not-send.rs:14:41 + | +LL | bar(Foo(std::ptr::null())).await; + | ^ +help: consider moving this into a `let` binding to create a shorter lived borrow + --> $DIR/issue-65436-raw-ptr-not-send.rs:14:13 + | +LL | bar(Foo(std::ptr::null())).await; + | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `assert_send` + --> $DIR/issue-65436-raw-ptr-not-send.rs:9:19 + | +LL | fn assert_send<T: Send>(_: T) {} + | ^^^^ required by this bound in `assert_send` + +error: aborting due to previous error + |