]> git.lizzy.rs Git - rust.git/blob - tests/ui/generator/issue-57478.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / generator / issue-57478.rs
1 // revisions: no_drop_tracking drop_tracking drop_tracking_mir
2 // [drop_tracking] compile-flags: -Zdrop-tracking
3 // [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
4 // [drop_tracking] check-pass
5 // [drop_tracking_mir] check-pass
6
7 #![feature(negative_impls, generators)]
8
9 struct Foo;
10 impl !Send for Foo {}
11
12 fn main() {
13     assert_send(|| {
14         //[no_drop_tracking]~^ ERROR generator cannot be sent between threads safely
15         let guard = Foo;
16         drop(guard);
17         yield;
18     })
19 }
20
21 fn assert_send<T: Send>(_: T) {}