btree/node.rs: pub fn dormant
should be marked as unsafe
#136255
Labels
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
This issue is about the "public" API of module
alloc/src/collections/btree/node.rs
. (The module itself is not public.)I don't know how serious people are about pursuing strong static typing for this API, but depending on that, I think both
dormant
functions (on NodeRef and on Handle) should be marked asunsafe
: the very existence of a dormant NodeRef/Handle is unsafe because it can be turned into aNodeRef<Immut<'a>, ...>
using non-unsafe
methodreborrow
and then inspected arbitrarily, which may cause races, aliasing rules violations, etc. with concurrent use of aNodeRef<Mut<'a>, ...>
existing at the same time.The text was updated successfully, but these errors were encountered: