]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-region-ptrs.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / consts / const-region-ptrs.rs
CommitLineData
b7449926
XL
1// run-pass
2#![allow(non_upper_case_globals)]
3
c34b1796 4struct Pair<'a> { a: isize, b: &'a isize }
223e47cc 5
c34b1796 6const x: &'static isize = &10;
223e47cc 7
1a4d82fc 8const y: &'static Pair<'static> = &Pair {a: 15, b: x};
223e47cc
LB
9
10pub fn main() {
1a4d82fc
JJ
11 println!("x = {}", *x);
12 println!("y = {{a: {}, b: {}}}", y.a, *(y.b));
970d7e83
LB
13 assert_eq!(*x, 10);
14 assert_eq!(*(y.b), 10);
223e47cc 15}