2023-03-29 22:51:27 -05:00
|
|
|
// compile-flags: -Ztrait-solver=next -Zdrop-tracking-mir
|
|
|
|
// 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 04:25:35 -05:00
|
|
|
#[allow(dropping_references)]
|
2023-03-29 22:51:27 -05:00
|
|
|
drop(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn bar() {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fn is_send(_: impl Send) {}
|
|
|
|
is_send(foo());
|
|
|
|
//[fail]~^ ERROR `impl Future<Output = ()>` cannot be sent between threads safely
|
|
|
|
}
|