]> git.proxmox.com Git - rustc.git/blame - src/test/ui/generator/static-mut-reference-across-yield.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / generator / static-mut-reference-across-yield.rs
CommitLineData
60c5eb7d 1// build-pass
17df50a5
XL
2// revisions: mir thir
3// [thir]compile-flags: -Zthir-unsafeck
4
60c5eb7d
XL
5#![feature(generators)]
6
7static mut A: [i32; 5] = [1, 2, 3, 4, 5];
8
9fn is_send_sync<T: Send + Sync>(_: T) {}
10
11fn 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}