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

17 lines
350 B
Rust
Raw Normal View History

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