]> git.lizzy.rs Git - rust.git/commit - src/tools/rustfmt
Auto merge of #78631 - ssomers:btree-alias_for_underfull, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Mon, 16 Nov 2020 03:22:10 +0000 (03:22 +0000)
committerbors <bors@rust-lang.org>
Mon, 16 Nov 2020 03:22:10 +0000 (03:22 +0000)
commitf5230fbf76bafd86ee4376a0e26e551df8d17fec
treea13d5a46cfc8d51a98b5cd279198c8b3653ee0e5
parentf4d014cee77f9112b2582d86085631c74413eb1e
parent4cfa5bddf105feb0c16f9023bb88ec50fcdc053f
Auto merge of #78631 - ssomers:btree-alias_for_underfull, r=Mark-Simulacrum

BTreeMap: fix pointer provenance rules in underfullness

Continuing on #78480, and for readability, and possibly for performance: avoid aliasing when handling underfull nodes, and consolidate the code doing that. In particular:
- Avoid the rather explicit aliasing for internal nodes in `remove_kv_tracking`.
- Climb down to the root to handle underfull nodes using a reborrowed handle, rather than one copied with `ptr::read`, before resuming on the leaf level.
- Integrate the code tracking leaf edge position into the functions performing changes, rather than bolting it on.

r? `@Mark-Simulacrum`