Skip to content

Commit 904133e

Browse files
committed
Revert to using mem::transmute in Box::into_unique
Seems to cause this error: "Cannot handle boxed::Box<[u8]> represented as TyLayout".
1 parent 8f167b3 commit 904133e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/liballoc/boxed.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,7 @@ impl<T: ?Sized> Box<T> {
326326
issue = "27730")]
327327
#[inline]
328328
pub fn into_unique(b: Box<T>) -> Unique<T> {
329-
let u = b.0;
330-
mem::forget(b);
331-
u
329+
unsafe { mem::transmute(b) }
332330
}
333331
}
334332

0 commit comments

Comments
 (0)