I would like to nominate trait-gen It really saved me. And it's so elegant to use. It feels like an "impl list" should be part of the language, at least until we have min_specialization
and / or generic_const_exprs
in stable.
Backstory:
I wanted to make two parallel objects with the same implementation (identical except one had an internal UnsafeCell
and the other doesn't) where both objects are available at runtime, both implement all the same traits and can be used interchangeably depending on the required usage.
But introducing generics to the impls exploded into a nightmare. Each new bound led to half a dozen needed bounds somewhere else. I needed to splitting traits in half. I needed to add associated types to traits. I needed to add parameters to traits that didn't have them.
By the time it was compiling again, the change involved touching 700 lines of code!!
Or I could have just used trait-gen
.