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