Add a test that assignment of unique boxes to locals does a copy
Issue #409
This commit is contained in:
parent
67bac873e0
commit
7c4fe10f02
10
src/test/run-pass/unique-assign-copy.rs
Normal file
10
src/test/run-pass/unique-assign-copy.rs
Normal file
@ -0,0 +1,10 @@
|
||||
fn main() {
|
||||
let i = ~mutable 1;
|
||||
// Should be a copy
|
||||
let j;
|
||||
j = i;
|
||||
*i = 2;
|
||||
*j = 3;
|
||||
assert *i == 2;
|
||||
assert *j == 3;
|
||||
}
|
Loading…
Reference in New Issue
Block a user