summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/ice-zst-static-access.rs
blob: b68e442a57c717d99abfe54b42dd46ed59ac7dee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// check-pass

// This is a regression test for ICEs from
// https://github.com/rust-lang/rust/issues/71612
// and
// https://github.com/rust-lang/rust/issues/71709

#[derive(Copy, Clone)]
pub struct Glfw;

static mut GLFW: Option<Glfw> = None;
pub fn new() -> Glfw {
    unsafe {
        if let Some(glfw) = GLFW {
            return glfw;
        } else {
            todo!()
        }
    };
}

extern "C" {
    static _dispatch_queue_attr_concurrent: [u8; 0];
}

static DISPATCH_QUEUE_CONCURRENT: &'static [u8; 0] =
    unsafe { &_dispatch_queue_attr_concurrent };

fn main() {
    *DISPATCH_QUEUE_CONCURRENT;
    new();
}