Skip to content

Non-boxed recursive tag constructor fails to compile with "Out of stack space" #1048

Closed
@mbrubeck

Description

@mbrubeck

If you try to compile tag list<T> { nil; cons(int, list<T>); } (note "list" instead of "@list" in the recursive constructor), then the compiler crashes with rt: e2b5:0x00000000: Out of stack space, sorry.

It would be nice to detect this condition and provide a more useful error message instead.

The bottom of the stack is:

#24545 0x080ff28e in middle::ty::type_structurally_contains::_5f3ac45ea1b71c45 ()
#24546 0x080ff28e in middle::ty::type_structurally_contains::_5f3ac45ea1b71c45 ()
#24547 0x080ff28e in middle::ty::type_structurally_contains::_5f3ac45ea1b71c45 ()
#24548 0x080ff28e in middle::ty::type_structurally_contains::_5f3ac45ea1b71c45 ()
#24549 0x080ff28e in middle::ty::type_structurally_contains::_5f3ac45ea1b71c45 ()
#24550 0x080ff28e in middle::ty::type_structurally_contains::_5f3ac45ea1b71c45 ()
#24551 0x08061feb in middle::trans::type_of_tag::_a125eb2fba6a34ee ()
#24552 0x08061522 in middle::trans::type_of_inner::_f9908926438f2236 ()
#24553 0x080603bb in middle::trans::type_of_fn::_d1c7c2dc9390d6d7 ()
#24554 0x08060a5e in middle::trans::type_of_fn_from_ty::_e121377dba6b8bd0 ()
#24555 0x080bc50c in middle::trans::register_fn_full::_3897f5c49d271367 ()
#24556 0x080bc358 in middle::trans::register_fn::_2c73ab4a26be7a7a ()
#24557 0x080c2fd1 in middle::trans::collect_tag_ctor::_5ff72ae6ae3153d1 ()
#24558 0x082a833e in middle::trans::collect_tag_ctors::thunk1669 ()
#24559 0x082c9589 in syntax::visit::default_visitor::thunk5653 ()
#24560 0x080c354b in middle::trans::collect_tag_ctors::_ec22d712145eb498 ()
#24561 0x080c9503 in middle::trans::trans_crate::_19245ca61421d176 ()
#24562 0x082e809b in driver::rustc::compile_input::thunk8685 ()
#24563 0x0827812d in driver::rustc::time::_8bcb4789e2c2f57e ()
#24564 0x0827acff in driver::rustc::compile_input::_c6e994438f359ee8 ()
#24565 0x08286208 in driver::rustc::main::_ed54e060591e3a31 ()
#24566 0x08286e93 in _rust_main ()
#24567 0x082eb12c in _rust_main_wrap ()
#24568 0x01337321 in task_start_wrapper (a=0xb7fe0010) at ../src/rt/rust_task.cpp:150
#24569 0xdeadbeef in ?? ()
#24570 0xb7fe0010 in ?? ()
#24571 0x00000010 in ?? ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions