rust/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
533 B
Rust
Raw Normal View History

// edition:2018
// revisions: no_drop_tracking drop_tracking drop_tracking_mir
// [drop_tracking] compile-flags: -Zdrop-tracking
// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
2022-09-13 21:39:36 +00:00
// [drop_tracking] check-pass
2023-01-26 03:51:26 +00:00
// [drop_tracking_mir] check-pass
struct Foo(*const u8);
unsafe impl Send for Foo {}
async fn bar(_: Foo) {}
fn assert_send<T: Send>(_: T) {}
fn main() {
assert_send(async {
2022-09-13 21:39:36 +00:00
//[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
bar(Foo(std::ptr::null())).await;
})
}