Skip to content

recursive enum runs out of stack #1821

Closed
@erickt

Description

@erickt

I always forget to put a recursive enum in a block. When I don't I get a non-helpful error:

enum t {
    foo([t])
}
fn main() {}

With this error:

error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: upcall fail 'explicit failure', ../src/comp/driver/rustc.rs:182
rust: domain main @0x102029600 root task failed

With RUST_LOG=rustc=0,::rt::backtrace, it says:

rust: task 101e019e0 ran out of stack
error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: upcall fail 'explicit failure', ../src/comp/driver/rustc.rs:182
rust: domain main @0x102029600 root task failed

It would be nice if we had an explicit error message for this situation.

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