about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-10-30 19:06:43 +0000
committerbors <bors@rust-lang.org>2015-10-30 19:06:43 +0000
commitcc8d398e28b6b1918ef85479c2d040dfd0fe582d (patch)
treeb509827a80ff356e37cf103d1af204eca809edfe /src/liballoc
parent2aa9f7d3916dcff36a5b8b4978981c056ceb8398 (diff)
parente351595c61614c41be08f7508422d5f8a02d1a0e (diff)
downloadrust-cc8d398e28b6b1918ef85479c2d040dfd0fe582d.tar.gz
rust-cc8d398e28b6b1918ef85479c2d040dfd0fe582d.zip
Auto merge of #29475 - apasel422:drop-in, r=alexcrichton
This is a rebase of #27204.

r? @alexcrichton 
CC @Gankro 
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs4
-rw-r--r--src/liballoc/lib.rs2
-rw-r--r--src/liballoc/rc.rs4
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.