]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-region-ptrs.rs
Rollup merge of #106951 - tmiasko:rm-simplify-initial, r=oli-obk
[rust.git] / tests / ui / consts / const-region-ptrs.rs
1 // run-pass
2 #![allow(non_upper_case_globals)]
3
4 struct Pair<'a> { a: isize, b: &'a isize }
5
6 const x: &'static isize = &10;
7
8 const y: &'static Pair<'static> = &Pair {a: 15, b: x};
9
10 pub fn main() {
11     println!("x = {}", *x);
12     println!("y = {{a: {}, b: {}}}", y.a, *(y.b));
13     assert_eq!(*x, 10);
14     assert_eq!(*(y.b), 10);
15 }