]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/ice-zst-static-access.rs
Rollup merge of #106962 - compiler-errors:use-sugg-span, r=oli-obk
[rust.git] / tests / ui / consts / ice-zst-static-access.rs
1 // check-pass
2
3 // This is a regression test for ICEs from
4 // https://github.com/rust-lang/rust/issues/71612
5 // and
6 // https://github.com/rust-lang/rust/issues/71709
7
8 #[derive(Copy, Clone)]
9 pub struct Glfw;
10
11 static mut GLFW: Option<Glfw> = None;
12 pub fn new() -> Glfw {
13     unsafe {
14         if let Some(glfw) = GLFW {
15             return glfw;
16         } else {
17             todo!()
18         }
19     };
20 }
21
22 extern "C" {
23     static _dispatch_queue_attr_concurrent: [u8; 0];
24 }
25
26 static DISPATCH_QUEUE_CONCURRENT: &'static [u8; 0] =
27     unsafe { &_dispatch_queue_attr_concurrent };
28
29 fn main() {
30     *DISPATCH_QUEUE_CONCURRENT;
31     new();
32 }