Skip to content

Commit 3bb7035

Browse files
committed
Add a test for unique boxes containing shared boxes
Issue #409
1 parent 3f41563 commit 3bb7035

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/run-pass/unique-copy-box.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use std;
2+
import std::sys::rustrt::refcount;
3+
4+
fn main() {
5+
let i = ~@1;
6+
let j = ~@2;
7+
let rc1 = refcount(*i);
8+
let j = i;
9+
let rc2 = refcount(*i);
10+
log_err #fmt("rc1: %u rc2: %u", rc1, rc2);
11+
assert rc1 + 1u == rc2;
12+
}

0 commit comments

Comments
 (0)