2011-09-22 16:39:57 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import 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);
|
|
|
|
let j = i;
|
|
|
|
let rc2 = refcount(*i);
|
2012-07-30 18:01:07 -05:00
|
|
|
error!{"rc1: %u rc2: %u", rc1, rc2};
|
2011-09-22 16:39:57 -05:00
|
|
|
assert rc1 + 1u == rc2;
|
|
|
|
}
|