summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-01-01 16:00:09 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-01-01 17:44:53 -0800
commite2e975181cc909c90f67f333d3fc903c5dc9a7f3 (patch)
tree92e57c67b2289f1ffea8afe6e90d4283401ad224 /src/liballoc
parentb65f0bedd2f22d9661ecb7092f07746dc2ccfb0d (diff)
downloadrust-e2e975181cc909c90f67f333d3fc903c5dc9a7f3.tar.gz
rust-e2e975181cc909c90f67f333d3fc903c5dc9a7f3.zip
[beta] Prepare the 1.24.0 beta release
* Update the channel of this release
* Update the bootstrap compiler to the dev artifacts
* Fix compile for last-minute backports
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/boxed.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 6f125cdba81..31e1184baff 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -300,7 +300,7 @@ impl<T: ?Sized> Box<T> {
                issue = "27730")]
     #[inline]
     pub unsafe fn from_unique(u: Unique<T>) -> Self {
-        Box(u)
+        mem::transmute(u)
     }
 
     /// Consumes the `Box`, returning the wrapped raw pointer.
@@ -362,9 +362,7 @@ impl<T: ?Sized> Box<T> {
                issue = "27730")]
     #[inline]
     pub fn into_unique(b: Box<T>) -> Unique<T> {
-        let unique = b.0;
-        mem::forget(b);
-        unique
+        unsafe { mem::transmute(b) }
     }
 
     /// Consumes and leaks the `Box`, returning a mutable reference,