rust/src/test/run-pass/issue-1989.rs
2012-08-01 19:16:06 -07:00

25 lines
333 B
Rust

// exec-env:RUST_CC_ZEAL=1
enum maybe_pointy {
none,
p(@pointy)
}
type pointy = {
mut a : maybe_pointy,
mut f : fn@()->(),
};
fn empty_pointy() -> @pointy {
return @{
mut a : none,
mut f : fn@()->(){},
}
}
fn main()
{
let v = ~[empty_pointy(), empty_pointy()];
v[0].a = p(v[0]);
}