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

20 lines
368 B
Rust
Raw Normal View History

// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
2010-06-23 21:03:09 -07:00
// -*- rust -*-
use std;
2011-07-27 14:19:39 +02:00
type cell = {mutable c: @list};
tag list { link(@cell); nil; }
2010-06-23 21:03:09 -07:00
fn main() {
2011-07-27 14:19:39 +02: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 14:19:39 +02:00
let third: @cell = @{mutable c: @nil()};
}