2012-08-03 20:07:45 -05:00
|
|
|
|
|
|
|
const x: &int = &10;
|
|
|
|
|
|
|
|
const y: &{a: int, b: &int} = &{a: 15, b: x};
|
|
|
|
|
|
|
|
fn main() {
|
2012-08-03 23:44:42 -05:00
|
|
|
io::println(fmt!("x = %?", *x));
|
2012-08-03 20:07:45 -05:00
|
|
|
io::println(fmt!("y = {a: %?, b: %?}", y.a, *(y.b)));
|
2012-08-03 23:44:42 -05:00
|
|
|
assert *x == 10;
|
|
|
|
assert *(y.b) == 10;
|
2012-08-03 20:07:45 -05:00
|
|
|
}
|