Skip to content

Commit

Permalink
Issue rust-lang#13933: Remove transmute_mut from Arc
Browse files Browse the repository at this point in the history
directly use the internal pointer instead.
  • Loading branch information
Ariel Ben-Yehuda committed May 28, 2014
1 parent def2232 commit 2e8bc99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

1 comment on commit 2e8bc99

@alexcrichton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.