Skip to content

Commit 2e8bc99

Browse files
author
Ariel Ben-Yehuda
committed
Issue #13933: Remove transmute_mut from Arc
directly use the internal pointer instead.
1 parent def2232 commit 2e8bc99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/liballoc/arc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ impl<T: Send + Share + Clone> Arc<T> {
160160
// reference count is guaranteed to be 1 at this point, and we required
161161
// the Arc itself to be `mut`, so we're returning the only possible
162162
// reference to the inner data.
163-
unsafe { mem::transmute::<&_, &mut _>(self.deref()) }
163+
let inner = unsafe { &mut *self._ptr };
164+
&mut inner.data
164165
}
165166
}
166167

0 commit comments

Comments
 (0)