parent
3f41563cc9
commit
3bb7035914
1 changed files with 12 additions and 0 deletions
12
src/test/run-pass/unique-copy-box.rs
Normal file
12
src/test/run-pass/unique-copy-box.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
use std;
|
||||
import std::sys::rustrt::refcount;
|
||||
|
||||
fn main() {
|
||||
let i = ~@1;
|
||||
let j = ~@2;
|
||||
let rc1 = refcount(*i);
|
||||
let j = i;
|
||||
let rc2 = refcount(*i);
|
||||
log_err #fmt("rc1: %u rc2: %u", rc1, rc2);
|
||||
assert rc1 + 1u == rc2;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue