]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/static-mut-reference-across-yield.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / generator / static-mut-reference-across-yield.rs
1 // build-pass
2 // revisions: mir thir
3 // [thir]compile-flags: -Zthir-unsafeck
4
5 #![feature(generators)]
6
7 static mut A: [i32; 5] = [1, 2, 3, 4, 5];
8
9 fn is_send_sync<T: Send + Sync>(_: T) {}
10
11 fn main() {
12     unsafe {
13         let gen_index = static || {
14             let u = A[{
15                 yield;
16                 1
17             }];
18         };
19         let gen_match = static || match A {
20             i if {
21                 yield;
22                 true
23             } =>
24             {
25                 ()
26             }
27             _ => (),
28         };
29         is_send_sync(gen_index);
30         is_send_sync(gen_match);
31     }
32 }