Hit an edge case in the #Rust compiler that appears to be quadratic at best and potentially exponential. Trivial to make happen with real-world code. Investigating...
@jhpratt looking forward to the repro and either finding out that it is a 2 line fix or requires a complete reimplementation of 2 stages of the compiler.
@predrag@ekuber Me too! I'm going to use the self-profile feature to try to determine where time is being spent. Creating a minimal reproduction may be tricky, as the underlying library is relatively intertwined.
Discarding the smallest checks as insignificant, it's certainly exponential. Best fit is an exponent of 1.27749 × the number of methods chained; correlation is 0.992.
A chain of 11 methods took 7m51s to type check, and I didn't dare to try 12 (which was my original code).
Add comment