rust/library/alloc
Yuki Okushi 814b31eb2e
Rollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum
BTreeMap::drain_filter should not touch the root during iteration

Although Miri doesn't point it out, I believe there is undefined behaviour using `drain_filter` when draining the 11th-last element from a tree that was larger. When this happens, the last remaining child nodes are merged, the root becomes empty and is popped from the tree. That last step establishes a mutable reference to the node elected root and writes a pointer in `node::Root`, while iteration continues to visit the same node.

This is mostly code from #74437, slightly adapted.
2020-08-03 01:05:13 +09:00
..
benches More benchmarks of BTreeMap mutation 2020-08-01 20:23:13 +02:00
src Rollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum 2020-08-03 01:05:13 +09:00
tests Add str::[r]split_once 2020-07-28 09:58:20 +02:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00