Revert to using mem::transmute in Box::from_raw

Same reasons as commit 904133e1e2.
This commit is contained in:
Nikolai Vazquez
2017-10-06 17:01:50 -04:00
parent 904133e1e2
commit 452b71a07b

View File

@@ -269,7 +269,7 @@ impl<T: ?Sized> Box<T> {
#[stable(feature = "box_raw", since = "1.4.0")] #[stable(feature = "box_raw", since = "1.4.0")]
#[inline] #[inline]
pub unsafe fn from_raw(raw: *mut T) -> Self { pub unsafe fn from_raw(raw: *mut T) -> Self {
Box(Unique::new_unchecked(raw)) mem::transmute(raw)
} }
/// Consumes the `Box`, returning the wrapped raw pointer. /// Consumes the `Box`, returning the wrapped raw pointer.