Skip to content

Commit 7c4fe10

Browse files
committed
Add a test that assignment of unique boxes to locals does a copy
Issue #409
1 parent 67bac87 commit 7c4fe10

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fn main() {
2+
let i = ~mutable 1;
3+
// Should be a copy
4+
let j;
5+
j = i;
6+
*i = 2;
7+
*j = 3;
8+
assert *i == 2;
9+
assert *j == 3;
10+
}

0 commit comments

Comments
 (0)