mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
27 lines
486 B
Rust
27 lines
486 B
Rust
// 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;
|
|
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
|
|
}
|