Skip to content

Commit f20775a

Browse files
committed
remove needs_drop
1 parent 437a10f commit f20775a

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
@@ -2179,10 +2179,8 @@ impl<T> InPlaceDrop<T> {
21792179
impl<T> Drop for InPlaceDrop<T> {
21802180
#[inline]
21812181
fn drop(&mut self) {
2182-
if mem::needs_drop::<T>() {
2183-
unsafe {
2184-
ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
2185-
}
2182+
unsafe {
2183+
ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
21862184
}
21872185
}
21882186
}
@@ -2912,10 +2910,8 @@ impl<T> IntoIter<T> {
29122910
}
29132911

29142912
fn drop_remaining(&mut self) {
2915-
if mem::needs_drop::<T>() {
2916-
unsafe {
2917-
ptr::drop_in_place(self.as_mut_slice());
2918-
}
2913+
unsafe {
2914+
ptr::drop_in_place(self.as_mut_slice());
29192915
}
29202916
self.ptr = self.end;
29212917
}

0 commit comments

Comments
 (0)