Skip to content

Compiler stack overflow caused by specific generics syntax #22375

New issue

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

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

Already on GitHub? # to your account

Closed
mattias-p opened this issue Feb 15, 2015 · 3 comments
Closed

Compiler stack overflow caused by specific generics syntax #22375

mattias-p opened this issue Feb 15, 2015 · 3 comments
Labels
A-type-system Area: Type system E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@mattias-p
Copy link

I tried pulling the old Java enum generics cleverness on rustc, and depending on the syntax used it either works as expected or plainly crashes.

This works just fine:

trait A<T> where T: A<T> {}

However this really upsets the compiler:

trait A<T: A<T>> {}
$ RUST_BACKTRACE=1 rustc src/lib.rs --crate-type lib

thread 'rustc' has overflowed its stack
Illegal instruction 
$ rustc --version --verbose
rustc 1.0.0-nightly (b63cee4a1 2015-02-14 17:01:11 +0000)
binary: rustc
commit-hash: b63cee4a11fcfecf20ed8419bc3bd6859e6496bc
commit-date: 2015-02-14 17:01:11 +0000
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
$ uname -a
Linux rust-m2 3.13.0-45-generic #74+7.0trisquel2 SMP Sat Jan 31 14:07:55 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
@steveklabnik
Copy link
Member

Is this a dup of #12644 ?

@nham
Copy link
Contributor

nham commented Jun 24, 2015

The code currently compiles, so I believe this issue can be closed.

@sfackler sfackler added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jun 24, 2015
@frewsxcv
Copy link
Member

I'll add a regression test

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-type-system Area: Type system E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

5 participants