Experimental feature "BTreeMap cursors": CursorMut.peek_prev() broken #111228
Labels
A-collections
Area: `std::collection`
C-bug
Category: This is a bug.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
While using the experimental new API "BTreeMap cursors" (tracking issue: #107540) I noticed that the CursorMut.peek_prev() API, which is documented to return the last element of the map if the cursor is pointing to the "ghost" non-element, returns the first element of the map instead. Not only does this disagree with the documentation, the immutable Cursor.peek_prev() API does the right thing. Here's a small testcase:
The CursorMut.peek_prev() API should, as documented, return the last element of the map if the cursor points at the "ghost" non-element.
Instead, this happened: It currently returns the first element of the map.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: