about summary refs log tree commit diff
path: root/src/liballoc/raw_vec.rs
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-08-23 10:39:30 +0300
committerEduard Burtescu <edy.burt@gmail.com>2016-08-24 13:23:37 +0300
commit119508cdb4051280a6b89d4ba1a8157f1113d379 (patch)
treeeaa0cb8e2df53fad235592948a07f400b2b93a87 /src/liballoc/raw_vec.rs
parentd0654ae5e53124273340624aa2e25f5a9aa9ecb3 (diff)
downloadrust-119508cdb4051280a6b89d4ba1a8157f1113d379.tar.gz
rust-119508cdb4051280a6b89d4ba1a8157f1113d379.zip
Remove drop flags from structs and enums implementing Drop.
Diffstat (limited to 'src/liballoc/raw_vec.rs')
-rw-r--r--src/liballoc/raw_vec.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs
index cdb70ce5770..23542215fa8 100644
--- a/src/liballoc/raw_vec.rs
+++ b/src/liballoc/raw_vec.rs
@@ -44,7 +44,7 @@ use core::cmp;
 /// `shrink_to_fit`, and `from_box` will actually set RawVec's private capacity
 /// field. This allows zero-sized types to not be special-cased by consumers of
 /// this type.
-#[unsafe_no_drop_flag]
+#[cfg_attr(stage0, unsafe_no_drop_flag)]
 pub struct RawVec<T> {
     ptr: Unique<T>,
     cap: usize,
@@ -546,13 +546,6 @@ impl<T> RawVec<T> {
         mem::forget(self);
         output
     }
-
-    /// This is a stupid name in the hopes that someone will find this in the
-    /// not too distant future and remove it with the rest of
-    /// #[unsafe_no_drop_flag]
-    pub fn unsafe_no_drop_flag_needs_drop(&self) -> bool {
-        self.cap != mem::POST_DROP_USIZE
-    }
 }
 
 impl<T> Drop for RawVec<T> {
@@ -560,7 +553,7 @@ impl<T> Drop for RawVec<T> {
     /// Frees the memory owned by the RawVec *without* trying to Drop its contents.
     fn drop(&mut self) {
         let elem_size = mem::size_of::<T>();
-        if elem_size != 0 && self.cap != 0 && self.unsafe_no_drop_flag_needs_drop() {
+        if elem_size != 0 && self.cap != 0 {
             let align = mem::align_of::<T>();
 
             let num_bytes = elem_size * self.cap;