rust/tests/ui/coroutine/drop-yield-twice.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
295 B
Rust
Raw Normal View History

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) {}