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> {
708
708
}
709
709
710
710
#[ 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 > {
712
712
/// Drops the `Arc`.
713
713
///
714
714
/// This will decrement the strong reference count. If the strong reference
@@ -736,7 +736,6 @@ impl<T: ?Sized> Drop for Arc<T> {
736
736
/// drop(foo); // Doesn't print anything
737
737
/// drop(foo2); // Prints "dropped!"
738
738
/// ```
739
- #[ unsafe_destructor_blind_to_params]
740
739
#[ inline]
741
740
fn drop ( & mut self ) {
742
741
// Because `fetch_sub` is already atomic, we do not need to synchronize
Original file line number Diff line number Diff line change 79
79
#![ feature( const_fn) ]
80
80
#![ feature( core_intrinsics) ]
81
81
#![ feature( custom_attribute) ]
82
- #![ feature( dropck_parametricity ) ]
82
+ #![ feature( dropck_eyepatch ) ]
83
83
#![ cfg_attr( not( test) , feature( exact_size_is_empty) ) ]
84
84
#![ feature( fundamental) ]
85
+ #![ feature( generic_param_attrs) ]
85
86
#![ feature( lang_items) ]
86
87
#![ feature( needs_allocator) ]
87
88
#![ feature( optin_builtin_traits) ]
Original file line number Diff line number Diff line change @@ -539,8 +539,7 @@ impl<T> RawVec<T> {
539
539
}
540
540
}
541
541
542
- impl < T > Drop for RawVec < T > {
543
- #[ unsafe_destructor_blind_to_params]
542
+ unsafe impl < #[ may_dangle] T > Drop for RawVec < T > {
544
543
/// Frees the memory owned by the RawVec *without* trying to Drop its contents.
545
544
fn drop ( & mut self ) {
546
545
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> {
644
644
}
645
645
646
646
#[ 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 > {
648
648
/// Drops the `Rc`.
649
649
///
650
650
/// This will decrement the strong reference count. If the strong reference
@@ -672,7 +672,6 @@ impl<T: ?Sized> Drop for Rc<T> {
672
672
/// drop(foo); // Doesn't print anything
673
673
/// drop(foo2); // Prints "dropped!"
674
674
/// ```
675
- #[ unsafe_destructor_blind_to_params]
676
675
fn drop ( & mut self ) {
677
676
unsafe {
678
677
let ptr = * self . ptr ;
Original file line number Diff line number Diff line change 30
30
31
31
#![ feature( alloc) ]
32
32
#![ feature( core_intrinsics) ]
33
+ #![ feature( dropck_eyepatch) ]
33
34
#![ feature( heap_api) ]
34
- #![ feature( heap_api ) ]
35
+ #![ feature( generic_param_attrs ) ]
35
36
#![ feature( staged_api) ]
36
- #![ feature( dropck_parametricity) ]
37
37
#![ cfg_attr( test, feature( test) ) ]
38
38
39
39
#![ allow( deprecated) ]
@@ -258,8 +258,7 @@ impl<T> TypedArena<T> {
258
258
}
259
259
}
260
260
261
- impl < T > Drop for TypedArena < T > {
262
- #[ unsafe_destructor_blind_to_params]
261
+ unsafe impl < #[ may_dangle] T > Drop for TypedArena < T > {
263
262
fn drop ( & mut self ) {
264
263
unsafe {
265
264
// Determine how much was filled.
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ pub struct BTreeMap<K, V> {
137
137
}
138
138
139
139
#[ 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 > {
142
141
fn drop ( & mut self ) {
143
142
unsafe {
144
143
for _ in ptr:: read ( self ) . into_iter ( ) {
Original file line number Diff line number Diff line change 35
35
#![ feature( box_syntax) ]
36
36
#![ cfg_attr( not( test) , feature( char_escape_debug) ) ]
37
37
#![ feature( core_intrinsics) ]
38
- #![ feature( dropck_parametricity ) ]
38
+ #![ feature( dropck_eyepatch ) ]
39
39
#![ feature( exact_size_is_empty) ]
40
40
#![ feature( fmt_internals) ]
41
41
#![ feature( fused) ]
42
+ #![ feature( generic_param_attrs) ]
42
43
#![ feature( heap_api) ]
43
44
#![ feature( inclusive_range) ]
44
45
#![ feature( lang_items) ]
Original file line number Diff line number Diff line change @@ -726,8 +726,7 @@ impl<T> LinkedList<T> {
726
726
}
727
727
728
728
#[ 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 > {
731
730
fn drop ( & mut self ) {
732
731
while let Some ( _) = self . pop_front_node ( ) { }
733
732
}
Original file line number Diff line number Diff line change @@ -1763,8 +1763,7 @@ impl<T: Ord> Ord for Vec<T> {
1763
1763
}
1764
1764
1765
1765
#[ 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 > {
1768
1767
fn drop ( & mut self ) {
1769
1768
unsafe {
1770
1769
// use drop for [T]
@@ -2033,8 +2032,7 @@ impl<T: Clone> Clone for IntoIter<T> {
2033
2032
}
2034
2033
2035
2034
#[ 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 > {
2038
2036
fn drop ( & mut self ) {
2039
2037
// destroy the remaining elements
2040
2038
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> {
69
69
}
70
70
71
71
#[ 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 > {
74
73
fn drop ( & mut self ) {
75
74
let ( front, back) = self . as_mut_slices ( ) ;
76
75
unsafe {
You can’t perform that action at this time.
0 commit comments