# Solving coherence problems with trait impls for closures: provide a \`Closure\` wrapper in libcore and make closure expressions evaluate to that type

**URL:** <https://internals.rust-lang.org/t/solving-coherence-problems-with-trait-impls-for-closures-provide-a-closure-wrapper-in-libcore-and-make-closure-expressions-evaluate-to-that-type/11174>\
**Category:** language design\
**Created:** [October 23, 2019, 1:25pm UTC](https://internals.rust-lang.org/t/solving-coherence-problems-with-trait-impls-for-closures-provide-a-closure-wrapper-in-libcore-and-make-closure-expressions-evaluate-to-that-type/11174 "2019-10-23T13:25:06Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![RustyYato](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/rustyyato/32/13627_2.png) [@RustyYato](https://internals.rust-lang.org/u/RustyYato)\
**Post date:** [October 23, 2019, 3:01pm UTC](https://internals.rust-lang.org/t/solving-coherence-problems-with-trait-impls-for-closures-provide-a-closure-wrapper-in-libcore-and-make-closure-expressions-evaluate-to-that-type/11174/5 "2019-10-23T15:01:43Z")

</div>

I like this idea, I have run into this exact issue a number of times, and this looks like a nice fix.

On the issue of function pointers, we could have then be the same type as `Closure<_>`, and just have it spelled the same way as today. This way it just works without breaking backwards compatibility. (Basically, make the current spelling a type alias for the more general feature). We don't have to worry about fn items becayse those are unnamable, so we could change those over to `Closure<_>` as well.

---

_[View the full topic](https://internals.rust-lang.org/t/solving-coherence-problems-with-trait-impls-for-closures-provide-a-closure-wrapper-in-libcore-and-make-closure-expressions-evaluate-to-that-type/11174)._
