We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5acfcce commit daccd17Copy full SHA for daccd17
compiler/rustc_arena/src/lib.rs
@@ -66,12 +66,7 @@ impl<T> TypedArenaChunk<T> {
66
// The branch on needs_drop() is an -O1 performance optimization.
67
// Without the branch, dropping TypedArena<u8> takes linear time.
68
if mem::needs_drop::<T>() {
69
- let mut start = self.start();
70
- // Destroy all allocated objects.
71
- for _ in 0..len {
72
- ptr::drop_in_place(start);
73
- start = start.offset(1);
74
- }
+ ptr::drop_in_place(MaybeUninit::slice_assume_init_mut(&mut self.storage[..len]));
75
}
76
77
0 commit comments