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

21 lines
344 B
Rust
Raw Normal View History

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