diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 33ca80ba372..95dcdd22fd0 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -77,7 +77,7 @@ use core::borrow; use core::fmt; use core::cmp::Ordering; use core::mem::{align_of_val, size_of_val}; -use core::intrinsics::{drop_in_place, abort}; +use core::intrinsics::abort; use core::mem; use core::ops::{Deref, CoerceUnsized}; use core::ptr::{self, Shared}; @@ -304,7 +304,7 @@ impl<T: ?Sized> Arc<T> { // Destroy the data at this time, even though we may not free the box // allocation itself (there may still be weak pointers lying around). - drop_in_place(&mut (*ptr).data); + ptr::drop_in_place(&mut (*ptr).data); if self.inner().weak.fetch_sub(1, Release) == 1 { atomic::fence(Acquire); diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index c78ebdf4340..899e7de4ed5 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -103,6 +103,8 @@ #![feature(unsize)] #![feature(core_slice_ext)] #![feature(core_str_ext)] +#![feature(drop_in_place)] + #![cfg_attr(stage0, feature(alloc_system))] #![cfg_attr(not(stage0), feature(needs_allocator))] diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index d695c0edd1d..463f66b58e9 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -160,7 +160,7 @@ use core::cell::Cell; use core::cmp::Ordering; use core::fmt; use core::hash::{Hasher, Hash}; -use core::intrinsics::{assume, drop_in_place, abort}; +use core::intrinsics::{assume, abort}; use core::marker::{self, Unsize}; use core::mem::{self, align_of_val, size_of_val, forget}; use core::ops::{CoerceUnsized, Deref}; @@ -460,7 +460,7 @@ impl<T: ?Sized> Drop for Rc<T> { self.dec_strong(); if self.strong() == 0 { // destroy the contained object - drop_in_place(&mut (*ptr).value); + ptr::drop_in_place(&mut (*ptr).value); // remove the implicit "strong weak" pointer now that we've // destroyed the contents. |
