summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2017-01-10 20:27:41 +0900
committerGitHub <noreply@github.com>2017-01-10 20:27:41 +0900
commitd350c9b15f3588525c043fd71872506345fd8281 (patch)
tree25023beb5622d2ab673fbdaeeba1626ffce406e4 /src/liballoc
parent4d3d2c73970c9842f1a0570963b0a4d1753ae3a9 (diff)
parentca9b07bbc974414e2b9055c5e50e38a1973401d2 (diff)
downloadrust-d350c9b15f3588525c043fd71872506345fd8281.tar.gz
rust-d350c9b15f3588525c043fd71872506345fd8281.zip
Rollup merge of #38664 - apasel422:may-dangle, r=pnkfelix
Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]`

CC #34761

r? @pnkfelix
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs3
-rw-r--r--src/liballoc/lib.rs3
-rw-r--r--src/liballoc/raw_vec.rs3
-rw-r--r--src/liballoc/rc.rs3
4 files changed, 5 insertions, 7 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index e1a240a0d2e..459dc94f336 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -708,7 +708,7 @@ impl<T: ?Sized> Arc<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: ?Sized> Drop for Arc<T> {
+unsafe impl<#[may_dangle] T: ?Sized> Drop for Arc<T> {
     /// Drops the `Arc`.
     ///
     /// This will decrement the strong reference count. If the strong reference
@@ -736,7 +736,6 @@ impl<T: ?Sized> Drop for Arc<T> {
     /// drop(foo);    // Doesn't print anything
     /// drop(foo2);   // Prints "dropped!"
     /// ```
-    #[unsafe_destructor_blind_to_params]
     #[inline]
     fn drop(&mut self) {
         // Because `fetch_sub` is already atomic, we do not need to synchronize
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 9ca9f93f3d3..c67106cf57a 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -79,9 +79,10 @@
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(custom_attribute)]
-#![feature(dropck_parametricity)]
+#![feature(dropck_eyepatch)]
 #![cfg_attr(not(test), feature(exact_size_is_empty))]
 #![feature(fundamental)]
+#![feature(generic_param_attrs)]
 #![feature(lang_items)]
 #![feature(needs_allocator)]
 #![feature(optin_builtin_traits)]
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs
index f23ea0ea8bf..357a2724e00 100644
--- a/src/liballoc/raw_vec.rs
+++ b/src/liballoc/raw_vec.rs
@@ -539,8 +539,7 @@ impl<T> RawVec<T> {
     }
 }
 
-impl<T> Drop for RawVec<T> {
-    #[unsafe_destructor_blind_to_params]
+unsafe impl<#[may_dangle] 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>();
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 86f8c746646..010e378ef2f 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -644,7 +644,7 @@ impl<T: ?Sized> Deref for Rc<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: ?Sized> Drop for Rc<T> {
+unsafe impl<#[may_dangle] T: ?Sized> Drop for Rc<T> {
     /// Drops the `Rc`.
     ///
     /// This will decrement the strong reference count. If the strong reference
@@ -672,7 +672,6 @@ impl<T: ?Sized> Drop for Rc<T> {
     /// drop(foo);    // Doesn't print anything
     /// drop(foo2);   // Prints "dropped!"
     /// ```
-    #[unsafe_destructor_blind_to_params]
     fn drop(&mut self) {
         unsafe {
             let ptr = *self.ptr;