Uh oh!
There was an error while loading. Please reload this page.
BTreeMap: tag internal functions with preconditions as unsafe - #68418
BTreeMap: tag internal functions with preconditions as unsafe#68418ssomers wants to merge 2 commits into
Conversation
Mark-Simulacrum
commented
Jan 21, 2020
While we're at this, is there a chance you could post the performance cost of moving the top-level "entry" functions in the node.rs module to being safe, and |
bors
commented
Jan 21, 2020
☔ The latest upstream changes (presumably #68423) made this pull request unmergeable. Please resolve the merge conflicts. |
…hared roots, or (fn insert) turn debug_assert into assert
ssomers
commented
Jan 22, 2020
If you mean really safe, as in making But there is some cheating here: public function |
ssomers
commented
Jan 22, 2020
I've sailed around My proposal then would be to turn debug_assert into assert in public functions, except |
Mark-Simulacrum
commented
Jan 22, 2020
So looking at the diff I think @RalfJung was right that this hides enough information that I'd rather not do it. Thanks for generating the diff though! It is I think notable that at least some of the |
ssomers
commented
Jan 22, 2020
I have added "unsafe because" information in my proposal. I'll open a new PR for that. |
…ark-Simulacrum BTreeMap: tag and explain unsafe internal functions or assert preconditions rust-lang#68418 concluded that it's not desirable to tag all internal functions with preconditions as being unsafe. This PR does it to some functions, documents why, and elsewhere enforces the preconditions with asserts.
#67686 ended up assuming that internal functions in node.rs that perform debug_assert, should either do a hard assert or should be declared unsafe. This set of commits does the latter, except for one function
insert(because it would require removing the subtle unsafe blocks in its implementation).(at this moment the list of commits contains #67686 because I managed to start from a different master)
r? @Mark-Simulacrum