Description
openedon Aug 14, 2020
While developing diesel we've hit a surprising increase in compile time caused by our trait impls for tuples. See diesel-rs/diesel#2480 for details. I've extracted a somewhat minimal example here. There is an option to control the tuple size up to which traits should be implemented in line 861. For a size of 16 the compilation of the example succeeds in less then 2 seconds using the rust-playground + the current stable compiler. For a tuple size > 20 the playground is terminated. (Diesel takes ~30s to build while implementing traits for tuples up to 16 elements, and 17 minutes while implementing traits for tuples up to 32 elements for my local setup).
I suspect that this is caused by the combination of a having a recursive trait bound here + enforcing that bound for each tuple size here. Diesel itself has not only one trait that requires Self: SqlType
, but probably the problem is increased by that.