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

12 lines
199 B
Rust
Raw Normal View History

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