2012-09-11 19:46:20 -05:00
|
|
|
extern mod std;
|
2012-09-05 14:32:05 -05:00
|
|
|
use sys::refcount;
|
2011-09-22 16:39:57 -05:00
|
|
|
|
2011-10-10 17:19:34 -05:00
|
|
|
fn main() unsafe {
|
2011-09-22 16:39:57 -05:00
|
|
|
let i = ~@1;
|
|
|
|
let j = ~@2;
|
|
|
|
let rc1 = refcount(*i);
|
2012-12-05 18:51:32 -06:00
|
|
|
let j = copy i;
|
2011-09-22 16:39:57 -05:00
|
|
|
let rc2 = refcount(*i);
|
2012-08-22 19:24:52 -05:00
|
|
|
error!("rc1: %u rc2: %u", rc1, rc2);
|
2011-09-22 16:39:57 -05:00
|
|
|
assert rc1 + 1u == rc2;
|
2012-12-05 18:51:32 -06:00
|
|
|
}
|