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

http://github.com/jruderman/rust · Rust · 15 lines · 10 code · 3 blank · 2 comment · 0 complexity · aea9d5fb31c3b1f78971b39363437e90 MD5 · raw file

  1. // xfail-test
  2. // -*- rust -*-
  3. use std;
  4. type cell = {mut c: @list};
  5. enum list { link(@cell), nil, }
  6. fn main() {
  7. let first: @cell = @{mut c: @nil()};
  8. let second: @cell = @{mut c: @link(first)};
  9. first._0 = @link(second);
  10. sys.rustrt.gc();
  11. let third: @cell = @{mut c: @nil()};
  12. }