rust/src/test/run-pass/let-destruct-fresh-mem.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

11 lines
202 B
Rust

fn main() {
let u = {x: 10, y: @{a: 20}};
let {x: x, y: @{a: a}} = u;
x = 100;
a = 100;
assert (x == 100);
assert (a == 100);
assert (u.x == 10);
assert (u.y.a == 20);
}