Kill needs_drop

This commit is contained in:
Manish Goregaokar 2017-08-25 15:48:03 -07:00
parent 926a08a4ab
commit db840f5227
2 changed files with 5 additions and 4 deletions

View file

@ -13,7 +13,7 @@ use alloc::heap::{Heap, Alloc, Layout};
use cmp;
use hash::{BuildHasher, Hash, Hasher};
use marker;
use mem::{align_of, size_of, needs_drop};
use mem::{align_of, size_of};
use mem;
use ops::{Deref, DerefMut};
use ptr::{self, Unique, Shared};
@ -1175,10 +1175,11 @@ unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable<K, V> {
// dropping empty tables such as on resize.
// Also avoid double drop of elements that have been already moved out.
unsafe {
if needs_drop::<(K, V)>() {
// FORK NOTE: Can't needs_drop on stable
// if needs_drop::<(K, V)>() {
// avoid linear runtime for types that don't need drop
self.rev_drop_buckets();
}
// }
}
let hashes_size = self.capacity() * size_of::<HashUint>();

View file

@ -1,7 +1,7 @@
#![feature(generic_param_attrs)]
#![feature(dropck_eyepatch)]
#![feature(allocator_api)]
#![feature(alloc, needs_drop, shared, unique, fused, placement_new_protocol)]
#![feature(alloc, shared, unique, fused, placement_new_protocol)]
extern crate alloc;