type pair = {
a: A, b: B
};
enum rec = _rec;
type _rec = {
val: A,
mut rec: option<@rec>
};
fn make_cycle(a: A) {
let g: @rec = @rec({val: a, mut rec: none});
g.rec = some(g);
}
fn f(a: A, b: B) -> fn@() -> (A, B) {
fn@() -> (A, B) { (a, b) }
}
fn main() {
let x = 22_u8;
let y = 44_u64;
let z = f(~x, y);
make_cycle(z);
let (a, b) = z();
#debug["a=%u b=%u", *a as uint, b as uint];
assert *a == x;
assert b == y;
}