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

16 lines
295 B
Rust
Raw Normal View History

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