Skip to content

Commit 28a530f

Browse files
committed
Add unsafe_destructor_blind_to_params attribute in spots where it is needed for run-pass tests.
I still cannot do complete run-pass run in `--enable-debug` (*) build due to rust-lang#27023. But these bits are certainly necessary. (*) (even after disabling debuginfo, see rust-lang#27139)
1 parent 2883fe2 commit 28a530f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/libcollections/btree/node.rs

+3
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,14 @@ impl<T> DoubleEndedIterator for RawItems<T> {
272272
}
273273

274274
impl<T> Drop for RawItems<T> {
275+
#[unsafe_destructor_blind_to_params]
275276
fn drop(&mut self) {
276277
for _ in self.by_ref() {}
277278
}
278279
}
279280

280281
impl<K, V> Drop for Node<K, V> {
282+
#[unsafe_destructor_blind_to_params]
281283
fn drop(&mut self) {
282284
if self.keys.is_null() ||
283285
(unsafe { self.keys.get() as *const K as usize == mem::POST_DROP_USIZE })
@@ -1394,6 +1396,7 @@ impl<K, V> TraversalImpl for MoveTraversalImpl<K, V> {
13941396
}
13951397

13961398
impl<K, V> Drop for MoveTraversalImpl<K, V> {
1399+
#[unsafe_destructor_blind_to_params]
13971400
fn drop(&mut self) {
13981401
// We need to cleanup the stored values manually, as the RawItems destructor would run
13991402
// after our deallocation.

src/libcollections/vec_deque.rs

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl<T: Clone> Clone for VecDeque<T> {
6565

6666
#[stable(feature = "rust1", since = "1.0.0")]
6767
impl<T> Drop for VecDeque<T> {
68+
#[unsafe_destructor_blind_to_params]
6869
fn drop(&mut self) {
6970
self.clear();
7071
unsafe {

src/test/run-pass/issue-24805-dropck-itemless.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
#![allow(non_camel_case_types)]
1515

16+
#![feature(unsafe_destructor_blind_to_params)]
17+
1618
trait UserDefined { }
1719

1820
impl UserDefined for i32 { }
@@ -26,7 +28,10 @@ impl<'a, T> UserDefined for &'a T { }
2628
macro_rules! impl_drop {
2729
($Bound:ident, $Id:ident) => {
2830
struct $Id<T:$Bound>(T);
29-
impl <T:$Bound> Drop for $Id<T> { fn drop(&mut self) { } }
31+
impl <T:$Bound> Drop for $Id<T> {
32+
#[unsafe_destructor_blind_to_params]
33+
fn drop(&mut self) { }
34+
}
3035
}
3136
}
3237

0 commit comments

Comments
 (0)