]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | // run-pass |
2 | #![allow(non_upper_case_globals)] | |
3 | ||
c34b1796 | 4 | struct Pair<'a> { a: isize, b: &'a isize } |
223e47cc | 5 | |
c34b1796 | 6 | const x: &'static isize = &10; |
223e47cc | 7 | |
1a4d82fc | 8 | const y: &'static Pair<'static> = &Pair {a: 15, b: x}; |
223e47cc LB |
9 | |
10 | pub 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 | } |