btree/node.rs: pub fn `dormant` should be marked as unsafe
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
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 as unsafe: the very existence of a dormant NodeRef/Handle is unsafe because it can be turned into a NodeRef<Immut<'a>, ...> using non-unsafe method reborrow and then inspected arbitrarily, which may cause races, aliasing rules violations, etc. with concurrent use of a NodeRef<Mut<'a>, ...> existing at the same time.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read library/alloc/src/collections/btree/node.rs, focusing on the dormant functions for NodeRef and Handle and the reborrow method. Determine whether both dormant APIs require unsafe callers to preserve aliasing guarantees; done means the API safety treatment is resolved consistently and covered by the relevant validation for this module.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100