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

12 lines
209 B
Rust
Raw Normal View History

2011-10-21 19:21:59 -05:00
type foo = { mutable z : fn@() };
fn nop() { }
fn nop_foo(_y: @int, _x : @foo) { }
2011-10-21 19:21:59 -05:00
fn o() -> @int { @10 }
2011-10-21 19:21:59 -05:00
fn main() {
let w = @{ mutable z: bind nop() };
let x = bind nop_foo(o(), w);
w.z = x;
}