2023-10-19 16:46:28 -05:00
|
|
|
#![feature(negative_impls, coroutines)]
|
2021-10-22 14:45:02 -05:00
|
|
|
|
|
|
|
struct Foo(i32);
|
|
|
|
impl !Send for Foo {}
|
|
|
|
|
|
|
|
fn main() {
|
2023-10-19 16:46:28 -05:00
|
|
|
assert_send(|| { //~ ERROR coroutine cannot be sent between threads safely
|
2021-10-22 14:45:02 -05:00
|
|
|
let guard = Foo(42);
|
|
|
|
yield;
|
|
|
|
drop(guard);
|
|
|
|
yield;
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
fn assert_send<T: Send>(_: T) {}
|