Closed
Description
struct A {
x: ~int,
mut y: ~[&~int],
}
fn A() -> A {
let a = A { x: ~1, y: ~[] };
vec::push(a.y, &a.x);
a
}
fn main() {
let a = A();
error!("%?", a);
}
Results in a secgault. The stack trace suggests it's in the repr function:
0x000000010007309d in repr::__extensions__::meth_10746::visit_self_describing_heap_alloc::_b764c3ece7f574bd::_04 ()
(gdb) bt
#0 0x000000010007309d in repr::__extensions__::meth_10746::visit_self_describing_heap_alloc::_b764c3ece7f574bd::_04 ()
#1 0x0000000000000000 in ?? ()