Closed
Description
enum tree<T: copy> { nil, node(~tree<T>, ~tree<T>, T) }
fn tree_init<T: copy>() -> ~tree<T> {
~nil
}
fn tree_add<T: copy>(i: T, t: ~tree<T>) -> ~tree<T> {
t
}
fn main() {
let atree: ~tree<int> = tree_init();
let btree = tree_add(1, atree);
log(debug, btree);
}
This gives:
rust: task 102027e00 ran out of stack
error: internal compiler error unexpected failure
I got the following stack trace from lldb:
* thread #6: tid = 0x2403, 0x0000000100fdc2a4 librustrt.dylib`upcall_fail + 4 at rust_upcall.cpp:129, stop reason = breakpoint 1.1
frame #0: 0x0000000100fdc2a4 librustrt.dylib`upcall_fail + 4 at rust_upcall.cpp:129
frame #1: 0x00000001000055d2 rustc`monitor::_7bab36b8b67b44ab + 1634
frame #2: 0x0000000100006d14 rustc`__morestack + 224
frame #3: 0x0000000100004f9c rustc`monitor::_7bab36b8b67b44ab + 44
frame #4: 0x00000001000066ea rustc`main::_6178e9efa23b8931 + 266
frame #5: 0x0000000100fda1b5 librustrt.dylib`task_start_wrapper(spawn_args*) + 37 at rust_task.cpp:129