From 2e8bc9924c096cb8f889d3f46ecce7ebe622b964 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Wed, 28 May 2014 14:09:50 +0300 Subject: [PATCH] Issue #13933: Remove transmute_mut from Arc directly use the internal pointer instead. --- src/liballoc/arc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 } }