summary refs log tree commit diff
path: root/src/test/run-pass/mlist-cycle.rs
blob: 3c7a5007f37c770de99da19645220a4838ec7ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// xfail-test
// -*- rust -*-
use std;

type cell = {mut c: @list};

enum list { link(@cell), nil, }

fn main() {
    let first: @cell = @{mut c: @nil()};
    let second: @cell = @{mut c: @link(first)};
    first._0 = @link(second);
    sys.rustrt.gc();
    let third: @cell = @{mut c: @nil()};
}