diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index a408bf8e284e7..546e4e5269979 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -160,7 +160,8 @@ impl Arc { // reference count is guaranteed to be 1 at this point, and we required // the Arc itself to be `mut`, so we're returning the only possible // reference to the inner data. - unsafe { mem::transmute::<&_, &mut _>(self.deref()) } + let inner = unsafe { &mut *self._ptr }; + &mut inner.data } }