@@ -172,8 +172,8 @@ impl<T, const N: usize> IterExt<T> for std::array::IntoIter<T, N> {
172
172
return & mut [ ] ;
173
173
}
174
174
// Move the content to the arena by copying and then forgetting it.
175
+ let start_ptr = arena. alloc_raw_slice ( len) ;
175
176
unsafe {
176
- let start_ptr = arena. alloc_raw_slice ( len) ;
177
177
self . as_slice ( ) . as_ptr ( ) . copy_to_nonoverlapping ( start_ptr, len) ;
178
178
mem:: forget ( self ) ;
179
179
slice:: from_raw_parts_mut ( start_ptr, len)
@@ -189,8 +189,8 @@ impl<T> IterExt<T> for Vec<T> {
189
189
return & mut [ ] ;
190
190
}
191
191
// Move the content to the arena by copying and then forgetting it.
192
+ let start_ptr = arena. alloc_raw_slice ( len) ;
192
193
unsafe {
193
- let start_ptr = arena. alloc_raw_slice ( len) ;
194
194
self . as_ptr ( ) . copy_to_nonoverlapping ( start_ptr, len) ;
195
195
self . set_len ( 0 ) ;
196
196
slice:: from_raw_parts_mut ( start_ptr, len)
@@ -206,8 +206,8 @@ impl<A: smallvec::Array> IterExt<A::Item> for SmallVec<A> {
206
206
return & mut [ ] ;
207
207
}
208
208
// Move the content to the arena by copying and then forgetting it.
209
+ let start_ptr = arena. alloc_raw_slice ( len) ;
209
210
unsafe {
210
- let start_ptr = arena. alloc_raw_slice ( len) ;
211
211
self . as_ptr ( ) . copy_to_nonoverlapping ( start_ptr, len) ;
212
212
self . set_len ( 0 ) ;
213
213
slice:: from_raw_parts_mut ( start_ptr, len)
@@ -251,7 +251,7 @@ impl<T> TypedArena<T> {
251
251
}
252
252
253
253
#[ inline]
254
- unsafe fn alloc_raw_slice ( & self , len : usize ) -> * mut T {
254
+ fn alloc_raw_slice ( & self , len : usize ) -> * mut T {
255
255
assert ! ( mem:: size_of:: <T >( ) != 0 ) ;
256
256
assert ! ( len != 0 ) ;
257
257
0 commit comments