rust/src/test/run-pass/unique-assign-copy.rs
2012-03-26 18:35:18 -07:00

10 lines
147 B
Rust

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