about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-11-10 14:45:19 +0100
committerGitHub <noreply@github.com>2020-11-10 14:45:19 +0100
commite15fee9fe47cb3c56d4cce514bc09b28f49d9655 (patch)
tree6af71fab446e3a9cac9e8c0b5dfed96b4d3e3943
parent9c486882e5dafac9676328e7515475e106031821 (diff)
parent8c7046e67537746fd6e404feb103305fe9a10aca (diff)
downloadrust-e15fee9fe47cb3c56d4cce514bc09b28f49d9655.tar.gz
rust-e15fee9fe47cb3c56d4cce514bc09b28f49d9655.zip
Rollup merge of #78854 - the8472:workaround-normalization-regression-master, r=Mark-Simulacrum
Workaround for "could not fully normalize" ICE

Workaround for "could not fully normalize" ICE (#78139) by removing the `needs_drop::<T>()` calls triggering it.
Corresponding beta PR: #78845

Fixes #78139 -- the underlying bug is likely not fixed but we don't have another test case isolated for now, so closing.
-rw-r--r--library/alloc/src/vec.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs
index 202e3a83638..2c8bc3d53ef 100644
--- a/library/alloc/src/vec.rs
+++ b/library/alloc/src/vec.rs
@@ -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;
     }