Skip to content

Commit 46800ab

Browse files
committed
Box::leak - made an oops, fixed now =)
1 parent ee24e99 commit 46800ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/liballoc/boxed.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ impl<T: ?Sized> Box<T> {
411411
#[unstable(feature = "box_leak", reason = "needs an FCP to stabilize",
412412
issue = "0")]
413413
#[inline]
414-
pub fn leak<'a, T: 'a>(b: Box<T>) -> &'a mut T {
414+
pub fn leak<'a>(b: Box<T>) -> &'a mut T
415+
where
416+
T: 'a // Technically not needed, but kept to be explicit.
417+
{
415418
unsafe { &mut *Box::into_raw(b) }
416419
}
417420
}

0 commit comments

Comments
 (0)