Uh oh!
There was an error while loading. Please reload this page.
BTreeMap: split off most code of append - #78417
Conversation
Mark-Simulacrum
commented
Nov 8, 2020
Hm, this seems fine, but I don't think we should make these methods unsafe without a justification for that -- if we have some unsafe code relying on sorted order in BTree, then that relies on PartialOrd/Ord returning consistent results, which is not necessarily true. Those can return a random choice of less/greater/equal to on each call, and we should not have any UB as a result of that (even if BTree is free to be quite confused and not return elements in the tree etc as a result). Ideally we wouldn't panic either but that's not too concerning, IMO, the important thing is that we don't have UB. |
ssomers
commented
Nov 8, 2020
Right. I did not realize the |
Mark-Simulacrum
commented
Nov 8, 2020
@bors r+ |
bors
commented
Nov 8, 2020
📌 Commit 685fd53 has been approved by |
bors
commented
Nov 9, 2020
⌛ Testing commit 685fd53 with merge 9264af3d945e005a0292a4a5ba0d23c08cb4d7a6... |
bors
commented
Nov 9, 2020
💥 Test timed out |
m-ou-se
commented
Nov 11, 2020
@bors retry |
…as-schievink Rollup of 11 pull requests Successful merges: - rust-lang#78216 (Duration::zero() -> Duration::ZERO) - rust-lang#78354 (Support enable/disable sanitizers/profiler per target) - rust-lang#78417 (BTreeMap: split off most code of append) - rust-lang#78832 (look at assoc ct, check the type of nodes) - rust-lang#78873 (Add flags customizing behaviour of MIR inlining) - rust-lang#78899 (Support inlining diverging function calls) - rust-lang#78923 (Cleanup and comment intra-doc link pass) - rust-lang#78929 (rustc_target: Move target env "gnu" from `linux_base` to `linux_gnu_base`) - rust-lang#78930 (rustc_taret: Remove `TargetOptions::is_like_android`) - rust-lang#78942 (Fix typo in comment) - rust-lang#78947 (Ship llvm-cov through llvm-tools) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
To complete #78056, move the last single-purpose pieces of code out of map.rs into a separate module. Also, tweaked documentation and safeness - I doubt think this code would be safe if the iterators passed in wouldn't be as sorted as the method says they should be - and bounds on MergeIterInner.
r? @Mark-Simulacrum