rust/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs
2024-02-16 20:02:50 +00:00

17 lines
232 B
Rust

//@ edition:2018
//@ 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 {
bar(Foo(std::ptr::null())).await;
})
}