Skip to content

Commit aafcdda

Browse files
committed
add another test for promoteds-in-static
1 parent 5fa69de commit aafcdda

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// check-pass
2+
#![allow(non_camel_case_types, non_upper_case_globals, static_mut_ref)]
3+
4+
pub struct wl_interface {
5+
pub version: i32
6+
}
7+
8+
pub struct Interface {
9+
pub other_interfaces: &'static [&'static Interface],
10+
pub c_ptr: Option<&'static wl_interface>,
11+
}
12+
13+
pub static mut wl_callback_interface: wl_interface = wl_interface {
14+
version: 0,
15+
};
16+
17+
pub static WL_CALLBACK_INTERFACE: Interface = Interface {
18+
other_interfaces: &[],
19+
c_ptr: Some(unsafe { &wl_callback_interface }),
20+
};
21+
22+
// This static contains a promoted that points to a static that points to a mutable static.
23+
pub static WL_SURFACE_INTERFACE: Interface = Interface {
24+
other_interfaces: &[&WL_CALLBACK_INTERFACE],
25+
c_ptr: None,
26+
};
27+
28+
fn main() {}

0 commit comments

Comments
 (0)