2012-05-17 20:18:20 -07:00
|
|
|
// exec-env:RUST_POISON_ON_FREE=1
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut x = @{f: ~3};
|
2012-12-07 21:56:46 -08:00
|
|
|
match x {
|
2012-12-07 22:00:55 -08:00
|
|
|
@{f: ref b_x} => {
|
|
|
|
assert **b_x == 3;
|
|
|
|
assert ptr::addr_of(&(*x.f)) == ptr::addr_of(&(**b_x));
|
2012-05-17 20:18:20 -07:00
|
|
|
|
|
|
|
x = @{f: ~4};
|
|
|
|
|
2012-12-07 22:00:55 -08:00
|
|
|
debug!("ptr::addr_of(*b_x) = %x", ptr::addr_of(&(**b_x)) as uint);
|
|
|
|
assert **b_x == 3;
|
|
|
|
assert ptr::addr_of(&(*x.f)) != ptr::addr_of(&(**b_x));
|
2012-05-17 20:18:20 -07:00
|
|
|
}
|
|
|
|
}
|
2012-12-07 21:56:46 -08:00
|
|
|
}
|