From 7c4fe10f02af2ded85d539f35869e6b1c1fe16cd Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Sep 2011 13:39:03 -0700 Subject: [PATCH] Add a test that assignment of unique boxes to locals does a copy Issue #409 --- src/test/run-pass/unique-assign-copy.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/test/run-pass/unique-assign-copy.rs diff --git a/src/test/run-pass/unique-assign-copy.rs b/src/test/run-pass/unique-assign-copy.rs new file mode 100644 index 00000000000..389480bff1c --- /dev/null +++ b/src/test/run-pass/unique-assign-copy.rs @@ -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; +} \ No newline at end of file