about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2024-11-23 13:19:17 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2024-11-28 13:43:05 -0500
commit4a216a25d143e88eefac2655c1fce042571e1f6e (patch)
treedd8b394804ef4dcee527cfa8e31f3b2ebded7612 /library/alloc/src
parent39cb3386ddc6c71657418be28dbb3987eea4aa4b (diff)
Share inline(never) generics across crates
This reduces code sizes and better respects programmer intent when
marking inline(never). Previously such a marking was essentially ignored
for generic functions, as we'd still inline them in remote crates.
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/raw_vec.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 85a9120c7e2..51b2a0570d9 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -757,7 +757,9 @@ impl<A: Allocator> RawVecInner<A> {
     }
 }
 
-#[inline(never)]
+// not marked inline(never) since we want optimizers to be able to observe the specifics of this
+// function, see tests/codegen/vec-reserve-extend.rs.
+#[cold]
 fn finish_grow<A>(
     new_layout: Layout,
     current_memory: Option<(NonNull<u8>, Layout)>,