# Same old issues recurring (self-referential types, generics less flexible than C++ templates)

**URL:** <https://internals.rust-lang.org/t/same-old-issues-recurring-self-referential-types-generics-less-flexible-than-c-templates/23603>\
**Category:** language design\
**Created:** [October 8, 2025, 11:32am UTC](https://internals.rust-lang.org/t/same-old-issues-recurring-self-referential-types-generics-less-flexible-than-c-templates/23603 "2025-10-08T11:32:20Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![SkiFire13](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/skifire13/32/7579_2.png) [@SkiFire13](https://internals.rust-lang.org/u/SkiFire13)\
**Post date:** [October 11, 2025, 7:37am UTC](https://internals.rust-lang.org/t/same-old-issues-recurring-self-referential-types-generics-less-flexible-than-c-templates/23603/21 "2025-10-11T07:37:18Z")

</div>

> [@djc](#):
>
> and I think you can probably build a cascade of `Backed`s to solve the general case?

The general case is IMO when `B` is a `Foo<'a>` defined in another crate (and thus cannot be changed). Since the self-referential part of `Backed` can only ever be a reference it follows that it cannot work for such structs.

---

<div class="post-metadata">

**Author:** ![Ddystopia](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ddystopia/32/10915_2.png) [@Ddystopia](https://internals.rust-lang.org/u/Ddystopia)\
**Post date:** [October 11, 2025, 9:27am UTC](https://internals.rust-lang.org/t/same-old-issues-recurring-self-referential-types-generics-less-flexible-than-c-templates/23603/22 "2025-10-11T09:27:12Z")

</div>

Placement new in a form of `super let` would help _a lot_.

---

<div class="post-metadata">

**Author:** ![jumpnbrownweasel](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jumpnbrownweasel/32/12426_2.png) [@jumpnbrownweasel](https://internals.rust-lang.org/u/jumpnbrownweasel)\
**Post date:** [October 15, 2025, 2:27am UTC](https://internals.rust-lang.org/t/same-old-issues-recurring-self-referential-types-generics-less-flexible-than-c-templates/23603/23 "2025-10-15T02:27:50Z")

</div>

> [@kpreid](#):
>
> IMO, the inability to express this is a missing piece of Rust's design. It limits abstraction, because it forces certain cases to be expressed as multiple variables in a stack frame, prohibiting them from ever being bundled together in a struct.

In my experience that's very true and well stated. I have gotten along without this in some cases by using Arc/Rc as workarounds, but this adds overhead (sometimes allocations) where none should be necessary. In other cases I've had to change data structures in ways that makes code more difficult to read and understand.

> [@kpreid](#):
>
> conflation of “Rust doesn't let you do this” with “_it is good that_ Rust doesn’t let you do this”,

I also agree with this. It is often said that writing in Rust makes the program strictly better in spite of causing restructuring due to Rust's restrictions. This is often true, but definitely sometimes not true.

[Previous page](https://internals.rust-lang.org/t/same-old-issues-recurring-self-referential-types-generics-less-flexible-than-c-templates/23603.md?page=1)
