# Object Safety is a terrible term

**URL:** <https://internals.rust-lang.org/t/object-safety-is-a-terrible-term/21025>\
**Category:** documentation\
**Created:** [June 13, 2024, 12:07pm UTC](https://internals.rust-lang.org/t/object-safety-is-a-terrible-term/21025 "2024-06-13T12:07:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kornel](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/kornel/32/2711_2.png) [@kornel](https://internals.rust-lang.org/u/kornel)\
**Post date:** [June 13, 2024, 12:07pm UTC](https://internals.rust-lang.org/t/object-safety-is-a-terrible-term/21025/1 "2024-06-13T12:07:55Z")

</div>

**edit:** this has been fixed! [Meeting proposal: rename "object safety" to "dyn compatibility" · Issue #286 · rust-lang/lang-team · GitHub](https://github.com/rust-lang/lang-team/issues/286#issue-2446833278)

* * *

The term "Object Safety" is like a "Guinea Pig" — not a pig, and not from Guinea.

Rust isn't a typical OOP language, so what is an "Object" (in the broad meaning) in Rust is unclear, and could be multiple things depending on one's interpretation. However, Object Safety is not about any objects, it's about traits. It's an abbreviated version of "Trait-Object Safety", but it leaves out the most relevant word!

Object Safety uses a colloquial meaning of safety unrelated to Rust's primary concept of safe/`unsafe`. That's a very unfortunate choice given how important the other kind of safety is to Rust. Users who are not already familiar with the jargon have no chance of correctly deducing what "object safety" is about. The term is not just opaque, but has a false similarity to wrong things.

### Fixes

At minimum the term could be clarified to be "Trait-Object Safety". This would make it clearly related to traits and trait objects, and still "backwards compatible" with the current wording.

But the "safety" here is really about compatibility, so it would be even better to call it "Trait-Object Compatible" or even "dyn-Trait Compatible" to make it entirely self-descriptive.

> <https://github.com/rust-lang/reference/pull/1512>
>
> "Object safe" is not a self-explanatory term. 
> 
> The the word "object" doesn't …have a clear definition in Rust's context, and to users it may not be obvious that the term refers to \*trait\* objects specifically.
> 
> The "safe" part is not good either, because it could be misunderstood as relating to "safe Rust" or not-\`unsafe\`.
> 
> However, the term "object safe" is used in a lot of places, so I propose a minimal backwards-compatible fix by calling this concept "trait-object safety". Addition of the word "trait" adds context, and clearly connects it to trait objects.
> 
> Users may only know this concept from \`Box\<dyn Trait\>\` types, so I'm also emphasising \`dyn Trait\` compatibility.
> 
> More in the forum thread:
> https://internals.rust-lang.org/t/object-safety-is-a-terrible-term/21025

---

_[View the full topic](https://internals.rust-lang.org/t/object-safety-is-a-terrible-term/21025)._
