]> git.lizzy.rs Git - rust.git/commitdiff
Box::leak - made an oops, fixed now =)
authorMazdak <twingoow@gmail.com>
Thu, 9 Nov 2017 22:39:18 +0000 (23:39 +0100)
committerMazdak <twingoow@gmail.com>
Thu, 9 Nov 2017 22:39:18 +0000 (23:39 +0100)
src/liballoc/boxed.rs

index 49f5f68fa770af12b0da58a520afcea9046a2ce7..c76f51057ff986c50c3a50e4b671aa70172dbb5d 100644 (file)
@@ -411,7 +411,10 @@ pub fn into_unique(b: Box<T>) -> Unique<T> {
     #[unstable(feature = "box_leak", reason = "needs an FCP to stabilize",
                issue = "0")]
     #[inline]
-    pub fn leak<'a, T: 'a>(b: Box<T>) -> &'a mut T {
+    pub fn leak<'a>(b: Box<T>) -> &'a mut T
+    where
+        T: 'a // Technically not needed, but kept to be explicit.
+    {
         unsafe { &mut *Box::into_raw(b) }
     }
 }