]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-cast-ptr-int.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / consts / const-cast-ptr-int.rs
CommitLineData
b7449926
XL
1// run-pass
2#![allow(non_upper_case_globals)]
c34b1796 3
970d7e83
LB
4use std::ptr;
5
1a4d82fc
JJ
6struct TestStruct {
7 x: *const u8
8}
9
10unsafe impl Sync for TestStruct {}
11
12static a: TestStruct = TestStruct{x: 0 as *const u8};
223e47cc
LB
13
14pub fn main() {
1a4d82fc 15 assert_eq!(a.x, ptr::null());
223e47cc 16}