Skip to content

btree: Reliance on structure layout #27620

Closed
@tbu-

Description

@tbu-

The function collections::btree::node::Node::as_slices_internal_mut relies on structure layout of two relatively unrelated structures to be the same, which is considered a bad thing™:

#[inline]
pub fn as_slices_internal_mut<'b>(&'b mut self) -> MutNodeSlice<'b, K, V> {
    unsafe { mem::transmute(self.as_slices_internal()) }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions