We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b2d115f commit 8c7046eCopy full SHA for 8c7046e
library/alloc/src/vec.rs
@@ -2136,10 +2136,8 @@ impl<T> InPlaceDrop<T> {
2136
impl<T> Drop for InPlaceDrop<T> {
2137
#[inline]
2138
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
- }
+ unsafe {
+ ptr::drop_in_place(slice::from_raw_parts_mut(self.inner, self.len()));
2143
}
2144
2145
@@ -2871,10 +2869,8 @@ impl<T> IntoIter<T> {
2871
2869
2872
2870
2873
fn drop_remaining(&mut self) {
2874
2875
2876
- ptr::drop_in_place(self.as_mut_slice());
2877
+ ptr::drop_in_place(self.as_mut_slice());
2878
2879
self.ptr = self.end;
2880
0 commit comments