Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions compiler/rustc_arena/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,9 @@ impl<T> TypedArena<T> {
// Also ensure that this chunk can fit `additional`.
new_cap = cmp::max(additional, new_cap);

let mut chunk = ArenaChunk::<T>::new(new_cap);
let chunk = chunks.push_mut(ArenaChunk::<T>::new(new_cap));
self.ptr.set(chunk.start());
self.end.set(chunk.end());
chunks.push(chunk);
}
}

Expand Down Expand Up @@ -419,7 +418,7 @@ impl DroplessArena {
// Also ensure that this chunk can fit `additional`.
new_cap = cmp::max(additional, new_cap);

let mut chunk = ArenaChunk::new(align_up(new_cap, PAGE));
let chunk = chunks.push_mut(ArenaChunk::new(align_up(new_cap, PAGE)));
self.start.set(chunk.start());

// Align the end to DROPLESS_ALIGNMENT.
Expand All @@ -430,8 +429,6 @@ impl DroplessArena {
debug_assert!(chunk.start().addr() <= end);

self.end.set(chunk.end().with_addr(end));

chunks.push(chunk);
}
}

Expand Down
3 changes: 1 addition & 2 deletions library/proc_macro/src/bridge/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ impl Arena {
// Also ensure that this chunk can fit `additional`.
new_cap = cmp::max(additional, new_cap);

let mut chunk = Box::new_uninit_slice(new_cap);
let chunk = chunks.push_mut(Box::new_uninit_slice(new_cap));
let Range { start, end } = chunk.as_mut_ptr_range();
self.start.set(start);
self.end.set(end);
chunks.push(chunk);
}

/// Allocates a byte slice with specified size from the current memory
Expand Down
Loading