2022-10-01 05:19:31 -05:00
|
|
|
// revisions: no_drop_tracking drop_tracking drop_tracking_mir
|
|
|
|
// [drop_tracking] compile-flags: -Zdrop-tracking
|
|
|
|
// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
|
|
|
|
// [drop_tracking] check-pass
|
2023-01-25 21:51:26 -06:00
|
|
|
// [drop_tracking_mir] check-pass
|
2022-01-21 11:36:24 -06:00
|
|
|
|
2021-10-08 17:09:20 -05:00
|
|
|
#![feature(negative_impls, generators)]
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
impl !Send for Foo {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_send(|| {
|
2022-10-01 05:19:31 -05:00
|
|
|
//[no_drop_tracking]~^ ERROR generator cannot be sent between threads safely
|
2021-10-08 17:09:20 -05:00
|
|
|
let guard = Foo;
|
|
|
|
drop(guard);
|
|
|
|
yield;
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
fn assert_send<T: Send>(_: T) {}
|