# Pre-RFC: Anonymous Trait Impls

**URL:** <https://internals.rust-lang.org/t/pre-rfc-anonymous-trait-impls/24648>\
**Category:** language design\
**Created:** [September 30, 2026, 1:26pm UTC](https://internals.rust-lang.org/t/pre-rfc-anonymous-trait-impls/24648 "2026-09-30T13:26:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jdahlstrom](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jdahlstrom/32/3351_2.png) [@jdahlstrom](https://internals.rust-lang.org/u/jdahlstrom)\
**Post date:** [September 30, 2026, 2:07pm UTC](https://internals.rust-lang.org/t/pre-rfc-anonymous-trait-impls/24648/2 "2026-09-30T14:07:01Z")

</div>

Some prior related discussions:

> [@Closure syntax for non-function traits](https://internals.rust-lang.org/t/closure-syntax-for-non-function-traits/5739):
>
> As impl Trait is getting closer to stabilization, I have been wondering about some syntactic sugaring. Perhaps this has been discussed before. If so, please let me know where. Current state On current nightly with #[feature(conservative\_impl\_trait)] enabled, if I want to write a function that returns an unboxed closure, I can do this: fn add\_number(a: i32) -\> impl Fn(i32) -\> i32 { move |b| a + b } This is nice, I can provide an implementation without going through all the trouble of (1) d…

> [@Idea: Anonymous \`impl\` types that support capturing like closures](https://internals.rust-lang.org/t/idea-anonymous-impl-types-that-support-capturing-like-closures/16314):
>
> I'm using the listener patterns heavily, and I hope there are anonymous impl types that support capturing like closures. When people are defining a listener, they have to define a struct and implement the trait for it. But since the type is used only once. using anonymous impl type can reduce the code to write and make it clearer. I know that it is a bad idea to use anonymous types in library code. But anonymous types (including closures) can help the client codes or test codes easier to write. …

> [@Closures and functional traits](https://internals.rust-lang.org/t/closures-and-functional-traits/23965):
>
> TL;DR: Assume we have following trait and a function that uses it: trait SingleMethodTrait\<T\> { fn do\_stuff\<'a\>(self, &'a T) -\> impl Future\<Output = ()\> + use\<'a\>; } async fn do\_bigger\_stuff( do\_stuff: impl SingleMethodTrait\<u32\>, ) { ... let inner\_param = 42u32; do\_stuff.do\_stuff(&inner\_param).await; ... } Then, we should be able to provide that trait's implementation by writing closure: do\_bigger\_stuff(async |i| { println!("{i}"); }).await; This should work if …

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-anonymous-trait-impls/24648)._
