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

15 lines
296 B
Rust
Raw Normal View History

// xfail-test
2010-06-23 21:03:09 -07:00
// -*- rust -*-
use std;
2012-03-26 18:35:18 -07:00
type cell = {mut c: @list};
enum list { link(@cell), nil, }
2010-06-23 21:03:09 -07:00
fn main() {
2012-03-26 18:35:18 -07:00
let first: @cell = @{mut c: @nil()};
let second: @cell = @{mut c: @link(first)};
first._0 = @link(second);
sys.rustrt.gc();
2012-03-26 18:35:18 -07:00
let third: @cell = @{mut c: @nil()};
}