Skip to content

Commit 1219014

Browse files
committed
Auto merge of #78845 - the8472:remove-needs-drop, r=Mark-Simulacrum
[beta] try to work around type normalization regression This just removes the offending lines that trigger #78139. I have doubts that this will actually solve the issue but it's simple enough to try. This PR needs a crater run for the failing crate.
2 parents 437a10f + f20775a commit 1219014

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)