Skip to content

btree/node.rs: pub fn dormant should be marked as unsafe #136255

Open
@btj

Description

@btj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions