]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #75200 - ssomers:btree_valmut, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Fri, 4 Sep 2020 23:16:23 +0000 (23:16 +0000)
committerbors <bors@rust-lang.org>
Fri, 4 Sep 2020 23:16:23 +0000 (23:16 +0000)
commit70c5f6efc445963bbfa5dd53f81c245741eac8cb
tree66d1b3dcd827a2d225a419d9395590c0875f7853
parentc59199efca5856cdf810919fbf9b5bce32dc4523
parente5f9d7ff92f62cde3ef1b7301ac4ac3adab990d9
Auto merge of #75200 - ssomers:btree_valmut, r=Mark-Simulacrum

 BTreeMap: introduce marker::ValMut and reserve Mut for unique access

The mutable BTreeMap iterators (apart from `DrainFilter`) are double-ended, meaning they have to rely on a front and a back handle that each represent a reference into the tree. Reserve a type category `marker::ValMut` for them, so that we guarantee that they cannot reach operations on handles with borrow type `marker::Mut`and that these operations can assume unique access to the tree.

Including #75195, benchmarks report no genuine change:
```
benchcmp old new --threshold 5
 name                                 old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
 btree::map::iter_100                 3,333        3,023                -310   -9.30%   x 1.10
 btree::map::range_unbounded_vs_iter  36,624       31,569             -5,055  -13.80%   x 1.16
```

r? @Mark-Simulacrum