Skip to content

Commit ff6ee2a

Browse files
committed
Auto merge of rust-lang#79113 - andjo403:raw_vec_ptr, r=m-ou-se
mark raw_vec::ptr with inline when a lot of vectors is used in a enum as in the example in rust-lang#66617 if this function is not inlined and multiple cgus is used this results in huge compile times. with this fix the compile time is 6s from minutes for the example in rust-lang#66617. I did not have the patience to wait for it to compile for more then 3 min.
2 parents f4eb5d9 + 88d1f31 commit ff6ee2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/alloc/src/raw_vec.rs

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ impl<T, A: Allocator> RawVec<T, A> {
232232
/// Gets a raw pointer to the start of the allocation. Note that this is
233233
/// `Unique::dangling()` if `capacity == 0` or `T` is zero-sized. In the former case, you must
234234
/// be careful.
235+
#[inline]
235236
pub fn ptr(&self) -> *mut T {
236237
self.ptr.as_ptr()
237238
}

0 commit comments

Comments
 (0)