rust/src/test/run-pass/mlist-cycle.rs

20 lines
373 B
Rust
Raw Normal View History

// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
2010-06-23 23:03:09 -05:00
// -*- rust -*-
use std;
type cell = rec(mutable @list c);
tag list { link(@cell); nil; }
2010-06-23 23:03:09 -05:00
fn main() {
let @cell first = @rec(mutable c=@nil());
let @cell second = @rec(mutable c=@link(first));
first._0 = @link(second);
std::sys.rustrt.gc();
let @cell third = @rec(mutable c=@nil());
}