diff options
| author | bors <bors@rust-lang.org> | 2022-10-09 21:02:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-09 21:02:33 +0000 |
| commit | 1a7c203e7f89f92598a793c6f6406735c024e7ee (patch) | |
| tree | 092e5362232165047754ef24ff91a0a242790bbf /compiler/rustc_codegen_llvm/src/llvm_util.rs | |
| parent | 81f391930301afbc121b7c468138069daa354bf8 (diff) | |
| parent | bb74f97445f04d68e42e7e308a109f78a2d2b0f7 (diff) | |
| download | rust-1a7c203e7f89f92598a793c6f6406735c024e7ee.tar.gz rust-1a7c203e7f89f92598a793c6f6406735c024e7ee.zip | |
Auto merge of #89123 - the8472:push_in_capacity, r=amanieu
add Vec::push_within_capacity - fallible, does not allocate This method can serve several purposes. It * is fallible * guarantees that items in Vec aren't moved * allows loops that do `reserve` and `push` separately to avoid pulling in the allocation machinery a second time in the `push` part which should make things easier on the optimizer * eases the path towards `ArrayVec` a bit since - compared to `push()` - there are fewer questions around how it should be implemented I haven't named it `try_push` because that should probably occupy a middle ground that will still try to reserve and only return an error in the unlikely OOM case. resolves #84649
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions
