Allowing calling static methods through trait objects

Quite a lot of previous discussion of the issues in Idea: object-safe static trait methods

EDIT: It also briefly mentions a workaround, provide both a static and dynamic method to allow access either way:

trait Template {
    fn size_hint() -> usize;
    fn dyn_size_hint(&self) -> usize {
        Self::size_hint()
    }
}
1 Like