diff options
| author | bors <bors@rust-lang.org> | 2021-01-26 02:56:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-26 02:56:37 +0000 |
| commit | ff6ee2a70218543f410e557f390e246131847572 (patch) | |
| tree | 6dccd2551882bd1396602faf360a7204436807cd | |
| parent | f4eb5d9f719cd3c849befc8914ad8ce0ddcf34ed (diff) | |
| parent | 88d1f31a904efdb28d504bc6dff5b6671a2f052b (diff) | |
| download | rust-ff6ee2a70218543f410e557f390e246131847572.tar.gz rust-ff6ee2a70218543f410e557f390e246131847572.zip | |
Auto merge of #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 #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 #66617. I did not have the patience to wait for it to compile for more then 3 min.
| -rw-r--r-- | library/alloc/src/raw_vec.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index 36e2d18d3dd..56f4ebe57f8 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -232,6 +232,7 @@ impl<T, A: Allocator> RawVec<T, A> { /// Gets a raw pointer to the start of the allocation. Note that this is /// `Unique::dangling()` if `capacity == 0` or `T` is zero-sized. In the former case, you must /// be careful. + #[inline] pub fn ptr(&self) -> *mut T { self.ptr.as_ptr() } |
