# \-\> impl Trait and object safety

**URL:** <https://internals.rust-lang.org/t/impl-trait-and-object-safety/20065>\
**Category:** language design\
**Created:** [December 21, 2023, 5:35pm UTC](https://internals.rust-lang.org/t/impl-trait-and-object-safety/20065 "2023-12-21T17:35:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maia-s](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/maia-s/32/11597_2.png) [@maia-s](https://internals.rust-lang.org/u/maia-s)\
**Post date:** [December 21, 2023, 5:35pm UTC](https://internals.rust-lang.org/t/impl-trait-and-object-safety/20065/1 "2023-12-21T17:35:16Z")

</div>

I read the latest blog post and I understand there's a desire to make traits with RPITIT object safe. I don't know how you intend to do this (would it be enough to store type layout information in the vtable?), but if this can be done, wouldn't it also let trait methods that return Self become object safe? `-> Self` would essentially be an alias for `-> impl current_trait`

(This could let us do things like e.g. `let cloned: Box<dyn Trait> = Box::new(trait_object.clone())` without the currently required workarounds for cloning trait objects)

I'm sorry if this belongs in the users forum; I posted it here because it asks about internal details.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 20, 2024, 5:36pm UTC](https://internals.rust-lang.org/t/impl-trait-and-object-safety/20065/2 "2024-03-20T17:36:13Z")

</div>

Closed on March 20, 2024, 5:36pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
