Skip to content

recursive enum runs out of stack #1821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
erickt opened this issue Feb 12, 2012 · 3 comments
Closed

recursive enum runs out of stack #1821

erickt opened this issue Feb 12, 2012 · 3 comments

Comments

@erickt
Copy link
Contributor

erickt commented Feb 12, 2012

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.

@marijnh
Copy link
Contributor

marijnh commented Feb 12, 2012

Argh. I fixed this a few weeks ago. Someone—probably me—broke it again it seems. Will look into it again.

@ghost ghost assigned marijnh Feb 12, 2012
@nikomatsakis
Copy link
Contributor

Why is this an error, actually? I should think it'd be ok to have a recursive reference in a vector.

@marijnh
Copy link
Contributor

marijnh commented Feb 12, 2012

Oh, that's probably why my fix doesn't catch this. I agree, we should probably support this.

brson added a commit that referenced this issue Feb 13, 2012
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants