# Allowing calling static methods through trait objects

**URL:** <https://internals.rust-lang.org/t/allowing-calling-static-methods-through-trait-objects/10417>\
**Category:** Uncategorized\
**Created:** [June 17, 2019, 12:12pm UTC](https://internals.rust-lang.org/t/allowing-calling-static-methods-through-trait-objects/10417 "2019-06-17T12:12:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Nemo157](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/nemo157/32/11585_2.png) [@Nemo157](https://internals.rust-lang.org/u/Nemo157)\
**Post date:** [June 17, 2019, 12:16pm UTC](https://internals.rust-lang.org/t/allowing-calling-static-methods-through-trait-objects/10417/2 "2019-06-17T12:16:14Z")

</div>

Quite a lot of previous discussion of the issues in [Idea: object-safe static trait methods](https://internals.rust-lang.org/t/idea-object-safe-static-trait-methods/8332)

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

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

```

---

_[View the full topic](https://internals.rust-lang.org/t/allowing-calling-static-methods-through-trait-objects/10417)._
