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

10 lines
177 B
Rust
Raw Normal View History

2012-03-26 18:35:18 -07:00
type foo = { mut z : fn@() };
2011-10-21 15:06:02 -07:00
fn nop() { }
fn nop_foo(_y: ~[int], _x : @foo) { }
2011-10-21 15:06:02 -07:00
fn main() {
2012-06-19 19:34:01 -07:00
let w = @{ mut z: {||nop()} };
let x = {||nop_foo(~[], w)};
2011-10-21 15:06:02 -07:00
w.z = x;
}