rust/library/alloc/src
bors 5c02926546 Auto merge of #84904 - ssomers:btree_drop_kv_in_place, r=Mark-Simulacrum
BTree: no longer copy keys and values before dropping them

When dropping BTreeMap or BTreeSet instances, keys-value pairs are up to now each copied and then dropped, at least according to source code. This is because the code for dropping and for iterators is shared.

This PR postpones the treatment of doomed key-value pairs from the intermediate functions `deallocating_next`(`_back`) to the last minute, so the we can drop the keys and values in place. According to the library/alloc benchmarks, this does make a difference, (and a positive difference with an `#[inline]` on `drop_key_val`). It does not change anything for #81444 though.

r? `@Mark-Simulacrum`
2021-05-11 19:36:54 +00:00
..
alloc Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
collections BTree: no longer copy keys and values before dropping them 2021-05-07 10:53:53 +02:00
prelude mv std libs to library/ 2020-07-27 19:51:13 -05:00
raw_vec Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
rc Re-stabilize Weak::as_ptr &friends for unsized T 2021-01-06 19:30:22 -05:00
sync Rollup merge of #80764 - CAD97:weak-unsized-as-ptr-again, r=RalfJung 2021-01-16 17:29:56 +00:00
vec alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
alloc.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
borrow.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
boxed.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
fmt.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
lib.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
macros.rs Only define rustc_diagnostic_item format_macro in not(test). 2021-02-14 20:03:13 +01:00
raw_vec.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
rc.rs Document Rc::from 2021-05-10 18:46:13 +08:00
slice.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
str.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
string.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
sync.rs alloc: Add unstable Cfg feature no-global_oom_handling 2021-05-05 16:49:04 -04:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Fix alloc::test::test_show 2021-04-21 15:45:41 +02:00