remove needs_drop

This commit is contained in:
The8472 2020-11-07 19:57:53 +01:00
parent b2d115f6db
commit 8c7046e675

View File

@ -2136,10 +2136,8 @@ impl<T> InPlaceDrop<T> {
impl<T> Drop for InPlaceDrop<T> {
#[inline]
fn drop(&mut self) {
if mem::needs_drop::<T>() {
unsafe {
ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
}
unsafe {
ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
}
}
}
@ -2871,10 +2869,8 @@ impl<T> IntoIter<T> {
}
fn drop_remaining(&mut self) {
if mem::needs_drop::<T>() {
unsafe {
ptr::drop_in_place(self.as_mut_slice());
}
unsafe {
ptr::drop_in_place(self.as_mut_slice());
}
self.ptr = self.end;
}