about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-09-20 07:23:42 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-09-28 15:44:48 +1000
commit0001eddb933ff9e5beeb8dd00c507b7abbd85e94 (patch)
tree0e4c1a5fcc573316611970d52ae1286e8d785244
parenta11f7e4c0f39c4665ec3b6c03b59fc9c9b7251a2 (diff)
downloadrust-0001eddb933ff9e5beeb8dd00c507b7abbd85e94.tar.gz
rust-0001eddb933ff9e5beeb8dd00c507b7abbd85e94.zip
Inline and remove `DroplessArena::grow_and_alloc`.
It has a single callsite.
-rw-r--r--compiler/rustc_arena/src/lib.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs
index d23ff64d667..0712f1efd64 100644
--- a/compiler/rustc_arena/src/lib.rs
+++ b/compiler/rustc_arena/src/lib.rs
@@ -463,12 +463,6 @@ impl DroplessArena {
         self.alloc_raw_without_grow(layout).unwrap()
     }
 
-    #[inline(never)]
-    #[cold]
-    fn grow_and_alloc<T>(&self) -> *mut u8 {
-        self.grow_and_alloc_raw(Layout::new::<T>())
-    }
-
     /// Allocates a byte slice with specified layout from the current memory
     /// chunk. Returns `None` if there is no free space left to satisfy the
     /// request.
@@ -517,7 +511,7 @@ impl DroplessArena {
         } else {
             // No free space left. Allocate a new chunk to satisfy the request.
             // On failure the grow will panic or abort.
-            self.grow_and_alloc::<T>()
+            self.grow_and_alloc_raw(Layout::new::<T>())
         } as *mut T;
 
         unsafe {