diff options
Diffstat (limited to 'src/liballoc/boxed.rs')
| -rw-r--r-- | src/liballoc/boxed.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 5406956a528..db7420954a0 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -469,8 +469,8 @@ impl<T: ?Sized> Box<T> { #[inline] #[doc(hidden)] pub fn into_unique(b: Box<T>) -> Unique<T> { + let b = mem::ManuallyDrop::new(b); let mut unique = b.0; - mem::forget(b); // Box is kind-of a library type, but recognized as a "unique pointer" by // Stacked Borrows. This function here corresponds to "reborrowing to // a raw pointer", but there is no actual reborrow here -- so |
