rust/src/test/run-pass/unique-decl-init-copy.rs
2011-09-22 13:53:33 -07:00

9 lines
140 B
Rust

fn main() {
let i = ~mutable 1;
// Should be a copy
let j = i;
*i = 2;
*j = 3;
assert *i == 2;
assert *j == 3;
}