> - It's impossible to describe a type that "implements trait A and may or may not implement trait B"
So, specialization? Or something else? I haven't found a need for specialization. I remember when I came from C++ I had a hard time adjusting to "no specialization, no variadics" but idk I haven't missed it in years.
> - It's impossible to be generic over a trait (not a type that implements a trait, the trait itself)
It seems like a way to ask "Can this thing implement X and if so how?" from say the Any trait would be what you want here, I have no idea how hard that would be to deliver but I also don't see how the previous trait thing is relevant, like, why do we need to say up front that maybe we will care whether trait B is implemented?
You can if you know all of the possible types in advance. But if you want to expose this as an interface from a library that allows users to provide their own custom implementation then you need to use traits.
- It's impossible to describe a type that "implements trait A and may or may not implement trait B"
- It's impossible to be generic over a trait (not a type that implements a trait, the trait itself)