2010-08-27 15:27:28 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
use std;
|
|
|
|
import std._str;
|
|
|
|
|
|
|
|
type t = tag(make_t(str), clam());
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let str s = "hi"; // ref up
|
|
|
|
let t x = make_t(s); // ref up
|
|
|
|
|
|
|
|
alt (x) {
|
|
|
|
case (make_t(y)) { log y; } // ref up and ref down
|
2010-08-27 15:29:48 -05:00
|
|
|
case (_) { log "?"; fail; }
|
2010-08-27 15:27:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
log _str.refcount(s);
|
|
|
|
check (_str.refcount(s) == 2u);
|
|
|
|
}
|