diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index ff7bff7584af9..dc02c9c883ea0 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -321,8 +321,12 @@ impl RawVec { // Therefore, we move all the resizing and error-handling logic from grow_amortized and // handle_reserve behind a call, while making sure that the this function is likely to be // inlined as just a comparison and a call if the comparison fails. - #[inline(never)] - fn do_reserve_and_handle(slf: &mut RawVec, len: usize, additional: usize) { + #[cold] + fn do_reserve_and_handle( + slf: &mut RawVec, + len: usize, + additional: usize, + ) { handle_reserve(slf.grow_amortized(len, additional)); }