File tree Expand file tree Collapse file tree 14 files changed +20
-29
lines changed Expand file tree Collapse file tree 14 files changed +20
-29
lines changed Original file line number Diff line number Diff line change @@ -708,7 +708,7 @@ impl<T: ?Sized> Arc<T> {
708708}
709709
710710#[ stable( feature = "rust1" , since = "1.0.0" ) ]
711- impl < T : ?Sized > Drop for Arc < T > {
711+ unsafe impl < # [ may_dangle ] T : ?Sized > Drop for Arc < T > {
712712 /// Drops the `Arc`.
713713 ///
714714 /// This will decrement the strong reference count. If the strong reference
@@ -736,7 +736,6 @@ impl<T: ?Sized> Drop for Arc<T> {
736736 /// drop(foo); // Doesn't print anything
737737 /// drop(foo2); // Prints "dropped!"
738738 /// ```
739- #[ unsafe_destructor_blind_to_params]
740739 #[ inline]
741740 fn drop ( & mut self ) {
742741 // Because `fetch_sub` is already atomic, we do not need to synchronize
Original file line number Diff line number Diff line change 7979#![ feature( const_fn) ]
8080#![ feature( core_intrinsics) ]
8181#![ feature( custom_attribute) ]
82- #![ feature( dropck_parametricity ) ]
82+ #![ feature( dropck_eyepatch ) ]
8383#![ cfg_attr( not( test) , feature( exact_size_is_empty) ) ]
8484#![ feature( fundamental) ]
85+ #![ feature( generic_param_attrs) ]
8586#![ feature( lang_items) ]
8687#![ feature( needs_allocator) ]
8788#![ feature( optin_builtin_traits) ]
Original file line number Diff line number Diff line change @@ -539,8 +539,7 @@ impl<T> RawVec<T> {
539539 }
540540}
541541
542- impl < T > Drop for RawVec < T > {
543- #[ unsafe_destructor_blind_to_params]
542+ unsafe impl < #[ may_dangle] T > Drop for RawVec < T > {
544543 /// Frees the memory owned by the RawVec *without* trying to Drop its contents.
545544 fn drop ( & mut self ) {
546545 let elem_size = mem:: size_of :: < T > ( ) ;
Original file line number Diff line number Diff line change @@ -644,7 +644,7 @@ impl<T: ?Sized> Deref for Rc<T> {
644644}
645645
646646#[ stable( feature = "rust1" , since = "1.0.0" ) ]
647- impl < T : ?Sized > Drop for Rc < T > {
647+ unsafe impl < # [ may_dangle ] T : ?Sized > Drop for Rc < T > {
648648 /// Drops the `Rc`.
649649 ///
650650 /// This will decrement the strong reference count. If the strong reference
@@ -672,7 +672,6 @@ impl<T: ?Sized> Drop for Rc<T> {
672672 /// drop(foo); // Doesn't print anything
673673 /// drop(foo2); // Prints "dropped!"
674674 /// ```
675- #[ unsafe_destructor_blind_to_params]
676675 fn drop ( & mut self ) {
677676 unsafe {
678677 let ptr = * self . ptr ;
Original file line number Diff line number Diff line change 3030
3131#![ feature( alloc) ]
3232#![ feature( core_intrinsics) ]
33+ #![ feature( dropck_eyepatch) ]
3334#![ feature( heap_api) ]
34- #![ feature( heap_api ) ]
35+ #![ feature( generic_param_attrs ) ]
3536#![ feature( staged_api) ]
36- #![ feature( dropck_parametricity) ]
3737#![ cfg_attr( test, feature( test) ) ]
3838
3939#![ allow( deprecated) ]
@@ -258,8 +258,7 @@ impl<T> TypedArena<T> {
258258 }
259259}
260260
261- impl < T > Drop for TypedArena < T > {
262- #[ unsafe_destructor_blind_to_params]
261+ unsafe impl < #[ may_dangle] T > Drop for TypedArena < T > {
263262 fn drop ( & mut self ) {
264263 unsafe {
265264 // Determine how much was filled.
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ pub struct BTreeMap<K, V> {
137137}
138138
139139#[ stable( feature = "btree_drop" , since = "1.7.0" ) ]
140- impl < K , V > Drop for BTreeMap < K , V > {
141- #[ unsafe_destructor_blind_to_params]
140+ unsafe impl < #[ may_dangle] K , #[ may_dangle] V > Drop for BTreeMap < K , V > {
142141 fn drop ( & mut self ) {
143142 unsafe {
144143 for _ in ptr:: read ( self ) . into_iter ( ) {
Original file line number Diff line number Diff line change 3535#![ feature( box_syntax) ]
3636#![ cfg_attr( not( test) , feature( char_escape_debug) ) ]
3737#![ feature( core_intrinsics) ]
38- #![ feature( dropck_parametricity ) ]
38+ #![ feature( dropck_eyepatch ) ]
3939#![ feature( exact_size_is_empty) ]
4040#![ feature( fmt_internals) ]
4141#![ feature( fused) ]
42+ #![ feature( generic_param_attrs) ]
4243#![ feature( heap_api) ]
4344#![ feature( inclusive_range) ]
4445#![ feature( lang_items) ]
Original file line number Diff line number Diff line change @@ -726,8 +726,7 @@ impl<T> LinkedList<T> {
726726}
727727
728728#[ stable( feature = "rust1" , since = "1.0.0" ) ]
729- impl < T > Drop for LinkedList < T > {
730- #[ unsafe_destructor_blind_to_params]
729+ unsafe impl < #[ may_dangle] T > Drop for LinkedList < T > {
731730 fn drop ( & mut self ) {
732731 while let Some ( _) = self . pop_front_node ( ) { }
733732 }
Original file line number Diff line number Diff line change @@ -1763,8 +1763,7 @@ impl<T: Ord> Ord for Vec<T> {
17631763}
17641764
17651765#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1766- impl < T > Drop for Vec < T > {
1767- #[ unsafe_destructor_blind_to_params]
1766+ unsafe impl < #[ may_dangle] T > Drop for Vec < T > {
17681767 fn drop ( & mut self ) {
17691768 unsafe {
17701769 // use drop for [T]
@@ -2033,8 +2032,7 @@ impl<T: Clone> Clone for IntoIter<T> {
20332032}
20342033
20352034#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2036- impl < T > Drop for IntoIter < T > {
2037- #[ unsafe_destructor_blind_to_params]
2035+ unsafe impl < #[ may_dangle] T > Drop for IntoIter < T > {
20382036 fn drop ( & mut self ) {
20392037 // destroy the remaining elements
20402038 for _x in self . by_ref ( ) { }
Original file line number Diff line number Diff line change @@ -69,8 +69,7 @@ impl<T: Clone> Clone for VecDeque<T> {
6969}
7070
7171#[ stable( feature = "rust1" , since = "1.0.0" ) ]
72- impl < T > Drop for VecDeque < T > {
73- #[ unsafe_destructor_blind_to_params]
72+ unsafe impl < #[ may_dangle] T > Drop for VecDeque < T > {
7473 fn drop ( & mut self ) {
7574 let ( front, back) = self . as_mut_slices ( ) ;
7675 unsafe {
You can’t perform that action at this time.
0 commit comments