-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc hangs on a non-regular ADT #36827
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
Comments
Using a one element tuple (
|
So the problem here seems to be, that due to the two element tuple, the type is growing exponentially and will probably consume all available ram long before the recursion limit has been reached. For those interested, here's a (truncated) log file: https://gist.github.com/4ea8b6207bd2b66e0899d90f8e30dfb7 |
I'm not sure, but it's possible that the underlying problem of issue 4363, infinite type generation, was never addressed. @nikomatsakis mentioned the possible need for an additional admission test for types in this comment from 2013. At the time the compiler was checking whether types are 'representable' (is the size finite?), 'instantiable' (can we write a finite-length instantiating expression?), but not whether they were 'monomorphizable' (will a finite amount of nested types be generated?). I think such an |
Closing.
|
This will keep CPU on 100% while slowly eating all the memory:
It's interesting that if I don't try to construct an instance of
S
, the program will compile just fine.1.11.0 stable and 1.13.0 nightly are affected.
The text was updated successfully, but these errors were encountered: