]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-cast-ptr-int.rs
Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb
[rust.git] / tests / ui / consts / const-cast-ptr-int.rs
1 // run-pass
2 #![allow(non_upper_case_globals)]
3
4 use std::ptr;
5
6 struct TestStruct {
7     x: *const u8
8 }
9
10 unsafe impl Sync for TestStruct {}
11
12 static a: TestStruct = TestStruct{x: 0 as *const u8};
13
14 pub fn main() {
15     assert_eq!(a.x, ptr::null());
16 }