about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2014-05-28 14:09:50 +0300
committerAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2014-05-28 19:39:46 +0300
commit2e8bc9924c096cb8f889d3f46ecce7ebe622b964 (patch)
treecdc5bf9072aefd828fd9b3650d5396e64c4ab560 /src/liballoc
parentdef2232595a68897cbaa1d3dc0820da5fe56f429 (diff)
downloadrust-2e8bc9924c096cb8f889d3f46ecce7ebe622b964.tar.gz
rust-2e8bc9924c096cb8f889d3f46ecce7ebe622b964.zip
Issue #13933: Remove transmute_mut from Arc
directly use the internal pointer instead.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index a408bf8e284..546e4e52699 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -160,7 +160,8 @@ impl<T: Send + Share + Clone> Arc<T> {
         // 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
     }
 }