]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs
Rollup merge of #106944 - Nilstrieb:there-once-was-a-diagnostic, r=WaffleLapkin
[rust.git] / tests / ui / async-await / issues / issue-65436-raw-ptr-not-send.rs
1 // edition:2018
2 // revisions: no_drop_tracking drop_tracking
3 // [drop_tracking] check-pass
4 // [drop_tracking] compile-flags: -Zdrop-tracking=yes
5 // [no_drop_tracking] compile-flags: -Zdrop-tracking=no
6
7 struct Foo(*const u8);
8
9 unsafe impl Send for Foo {}
10
11 async fn bar(_: Foo) {}
12
13 fn assert_send<T: Send>(_: T) {}
14
15 fn main() {
16     assert_send(async {
17         //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
18         bar(Foo(std::ptr::null())).await;
19     })
20 }