# \`Rc/Arc::Borrowed\`: An object-safe version of \`&Rc\<T\>\`/\`&Arc\<T\>\`

**URL:** <https://internals.rust-lang.org/t/rc-arc-borrowed-an-object-safe-version-of-rc-t-arc-t/8896>\
**Category:** Uncategorized\
**Created:** [November 25, 2018, 1:04am UTC](https://internals.rust-lang.org/t/rc-arc-borrowed-an-object-safe-version-of-rc-t-arc-t/8896 "2018-11-25T01:04:57Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![kennytm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/kennytm/32/161_2.png) [@kennytm](https://internals.rust-lang.org/u/kennytm)\
**Post date:** [November 25, 2018, 8:29pm UTC](https://internals.rust-lang.org/t/rc-arc-borrowed-an-object-safe-version-of-rc-t-arc-t/8896/11 "2018-11-25T20:29:15Z")

</div>

> [@mikeyhew](#):
>
> The problem is you need to turn an `&Rc<dyn Trait>` into an `&Rc<T>` , and I don’t really see a good way to do that, since we’re changing what the reference points to.

A bad way to do that is simply transmute `&Rc<dyn Trait>` to `&Rc<T>`. This works because `&Rc<dyn Trait>` should be represented as `&(Rc<()>, &VTable)`, so we could reinterpret-cast the reference to only refer to its header `&Rc<()>`. This is similar to C-style cast to base-class.

---

_[View the full topic](https://internals.rust-lang.org/t/rc-arc-borrowed-an-object-safe-version-of-rc-t-arc-t/8896)._
