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
330 B
Rust
Raw Normal View History

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