Right now apparently static methods cannot be called from trait objects. Is there any inherent reason why this is the case? It seems like trait objects could easily grow vtable slots to include static methods?
My motivating use case is a
size_hint() method used in Askama
Template trait. It used to take
&self, but someone reasonably pointed out that, since the size was computed at compile time, the parameter wasn’t needed. However, I then got an issue that templates can now no longer be used as trait objects, which is desirable in some use cases to prevent code size blowup.
I’m happy to write up an RFC if this turns out to be non-controversial, but maybe there’s something I’m overlooking.