Skip to content

Commit 8c7046e

Browse files
committed
remove needs_drop
1 parent b2d115f commit 8c7046e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

library/alloc/src/vec.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -2136,10 +2136,8 @@ impl<T> InPlaceDrop<T> {
21362136
impl<T> Drop for InPlaceDrop<T> {
21372137
#[inline]
21382138
fn drop(&mut self) {
2139-
if mem::needs_drop::<T>() {
2140-
unsafe {
2141-
ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
2142-
}
2139+
unsafe {
2140+
ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
21432141
}
21442142
}
21452143
}
@@ -2871,10 +2869,8 @@ impl<T> IntoIter<T> {
28712869
}
28722870

28732871
fn drop_remaining(&mut self) {
2874-
if mem::needs_drop::<T>() {
2875-
unsafe {
2876-
ptr::drop_in_place(self.as_mut_slice());
2877-
}
2872+
unsafe {
2873+
ptr::drop_in_place(self.as_mut_slice());
28782874
}
28792875
self.ptr = self.end;
28802876
}

0 commit comments

Comments
 (0)