File tree Expand file tree Collapse file tree
library/proc_macro/src/bridge Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,10 +287,9 @@ impl<T> TypedArena<T> {
287287 // Also ensure that this chunk can fit `additional`.
288288 new_cap = cmp:: max ( additional, new_cap) ;
289289
290- let mut chunk = ArenaChunk :: < T > :: new ( new_cap) ;
290+ let chunk = chunks . push_mut ( ArenaChunk :: < T > :: new ( new_cap) ) ;
291291 self . ptr . set ( chunk. start ( ) ) ;
292292 self . end . set ( chunk. end ( ) ) ;
293- chunks. push ( chunk) ;
294293 }
295294 }
296295
@@ -419,7 +418,7 @@ impl DroplessArena {
419418 // Also ensure that this chunk can fit `additional`.
420419 new_cap = cmp:: max ( additional, new_cap) ;
421420
422- let mut chunk = ArenaChunk :: new ( align_up ( new_cap, PAGE ) ) ;
421+ let chunk = chunks . push_mut ( ArenaChunk :: new ( align_up ( new_cap, PAGE ) ) ) ;
423422 self . start . set ( chunk. start ( ) ) ;
424423
425424 // Align the end to DROPLESS_ALIGNMENT.
@@ -430,8 +429,6 @@ impl DroplessArena {
430429 debug_assert ! ( chunk. start( ) . addr( ) <= end) ;
431430
432431 self . end . set ( chunk. end ( ) . with_addr ( end) ) ;
433-
434- chunks. push ( chunk) ;
435432 }
436433 }
437434
Original file line number Diff line number Diff line change @@ -58,11 +58,10 @@ impl Arena {
5858 // Also ensure that this chunk can fit `additional`.
5959 new_cap = cmp:: max ( additional, new_cap) ;
6060
61- let mut chunk = Box :: new_uninit_slice ( new_cap) ;
61+ let chunk = chunks . push_mut ( Box :: new_uninit_slice ( new_cap) ) ;
6262 let Range { start, end } = chunk. as_mut_ptr_range ( ) ;
6363 self . start . set ( start) ;
6464 self . end . set ( end) ;
65- chunks. push ( chunk) ;
6665 }
6766
6867 /// Allocates a byte slice with specified size from the current memory
You can’t perform that action at this time.
0 commit comments