2020-01-18 22:59:59 -06:00
|
|
|
// edition:2018
|
2022-10-01 05:19:31 -05:00
|
|
|
// 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 16:39:36 -05:00
|
|
|
// [drop_tracking] check-pass
|
2023-01-25 21:51:26 -06:00
|
|
|
// [drop_tracking_mir] check-pass
|
2020-01-18 22:59:59 -06:00
|
|
|
|
|
|
|
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 16:39:36 -05:00
|
|
|
//[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
|
2020-01-18 22:59:59 -06:00
|
|
|
bar(Foo(std::ptr::null())).await;
|
|
|
|
})
|
|
|
|
}
|