# \[IDEA\] Implied enum types

**URL:** <https://internals.rust-lang.org/t/idea-implied-enum-types/18349>\
**Category:** language design\
**Created:** [February 15, 2023, 3:02am UTC](https://internals.rust-lang.org/t/idea-implied-enum-types/18349 "2023-02-15T03:02:31Z")\
**Posts on this page:** 1\
**Showing post:** 82

<div class="post-metadata">

**Author:** ![CAD97](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cad97/32/3460_2.png) [@CAD97](https://internals.rust-lang.org/u/CAD97)\
**Post date:** [June 14, 2023, 4:23am UTC](https://internals.rust-lang.org/t/idea-implied-enum-types/18349/82 "2023-06-14T04:23:29Z")

</div>

If anything, `T::default()` gets used because it's shorter than `Default::default()`. There's an unstable [`fn default`](https://doc.rust-lang.org/stable/std/default/fn.default.html) which exists to make it possible to just write `default()`, even. It's a [fairly common request](https://internals.rust-lang.org/t/importing-associated-static-struct-functions/18978) to be able to `use path::to::Trait::function;` to be able to write `function()` instead of `Trait::function()`; the example almost always used in this request is `Default::default`.

So yeah, while it's not uncommon for people to prefer `T::default()` over `Default::default()`, it's at least as not uncommon for people to use `Default::default()`.

If you've ever seen/used [`.collect()`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) or [`.into()`](https://doc.rust-lang.org/stable/std/convert/trait.Into.html#tymethod.into), it's the exact same inference of generic return type as with `Default::default()`, but even more inconvenient to avoid relying on inference backflow.

---

_[View the full topic](https://internals.rust-lang.org/t/idea-implied-enum-types/18349)._
