summary refs log tree commit diff
path: root/src/test/run-pass/unique-copy-box.rs
blob: a25155db3d706bcd69e885bcfe4ff838ac2da03b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use std;
import sys::refcount;

fn main() unsafe {
    let i = ~@1;
    let j = ~@2;
    let rc1 = refcount(*i);
    let j = i;
    let rc2 = refcount(*i);
    #error("rc1: %u rc2: %u", rc1, rc2);
    assert rc1 + 1u == rc2;
}