Issue #13933: Remove transmute_mut from Arc

directly use the internal pointer instead.
This commit is contained in:
Ariel Ben-Yehuda 2014-05-28 14:09:50 +03:00
parent def2232595
commit 2e8bc9924c
1 changed files with 2 additions and 1 deletions

View File

@ -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
}
}