Do not inline finish_grow
We also change the specialization of `SpecFromIterNested::from_iter` for `TrustedLen` to use `Vec::with_capacity` when the iterator has a proper size hint, instead of `Vec::new`, avoiding calls to `grow_*` and thus `finish_grow` in some fully inlinable cases, which would regress with this change. Fixes #78471.
This commit is contained in:
parent
87776d7d53
commit
76bd145489
2 changed files with 5 additions and 1 deletions
|
@ -471,6 +471,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
|
|||
// above `RawVec::grow_amortized` for details. (The `A` parameter isn't
|
||||
// significant, because the number of different `A` types seen in practice is
|
||||
// much smaller than the number of `T` types.)
|
||||
#[inline(never)]
|
||||
fn finish_grow<A>(
|
||||
new_layout: Result<Layout, LayoutError>,
|
||||
current_memory: Option<(NonNull<u8>, Layout)>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue