Closed
Description
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