2023-12-14 12:11:28 +00:00
|
|
|
//@ compile-flags: -Znext-solver
|
2023-03-30 03:51:27 +00:00
|
|
|
//@ edition: 2021
|
|
|
|
//@ revisions: pass fail
|
|
|
|
//@[pass] check-pass
|
|
|
|
|
|
|
|
#![feature(negative_impls)]
|
|
|
|
|
|
|
|
struct NotSync;
|
|
|
|
impl !Sync for NotSync {}
|
|
|
|
|
|
|
|
async fn foo() {
|
|
|
|
#[cfg(pass)]
|
|
|
|
let x = &();
|
|
|
|
#[cfg(fail)]
|
|
|
|
let x = &NotSync;
|
|
|
|
bar().await;
|
2023-05-19 09:25:35 +00:00
|
|
|
#[allow(dropping_references)]
|
2023-03-30 03:51:27 +00:00
|
|
|
drop(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn bar() {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fn is_send(_: impl Send) {}
|
|
|
|
is_send(foo());
|
2024-05-01 20:03:26 +00:00
|
|
|
//[fail]~^ ERROR future cannot be sent between threads safely
|
2023-03-30 03:51:27 +00:00
|
|
|
}
|