compiler trait solver gets stuck (infinite loop or tail recursion?), related to GAT and associated type equality constraint #134370
Labels
A-GATs
Area: Generic associated types (GATs)
C-bug
Category: This is a bug.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
I-hang
Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I was playing with GAT and stomped upon this weird issue, and here's a reproducible example that I managed to reduced to:
some research and observations:
Ty :Foo
bound towhere
clause like the following, it will NOT hang:Assoc
has not associated type constraint, it will NOT hang:E0582
:Assoc
trait in the reproducing example wasIterator
in my original code where I encountered this problemI expected to see this happen: the compiler either accept or reject the code;
Instead, this happened: the compiler never finish while using 100% of one of the CPU cores.
Meta
rustc --version --verbose
:Backtrace:
the compiler didn't crash, no backtrace available
RUSTC_LOG=debug
because the compilation never finish, the log is infinitely sized and repeating, and since the issue is reproducible, I'll only attach the lines where it starts to repeat:
The text was updated successfully, but these errors were encountered: