diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 512c7194fe3..6b92da11079 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -326,9 +326,7 @@ impl Box { issue = "27730")] #[inline] pub fn into_unique(b: Box) -> Unique { - let u = b.0; - mem::forget(b); - u + unsafe { mem::transmute(b) } } }