Skip to content

Heads-up: UB due to misuse of mem::uninitialized will soon lead to panic #2

Closed
@RalfJung

Description

@RalfJung

Here, this crate causes UB by "Producing an invalid value". Concretely, it creates an arbitrary T with mem::uninitialized(). In the near future the call to mem::uninitialized() will panic to avoid UB, and our crater run determined that this crate will be affected.

mem::uninitialized() is deprecated since Rust 1.39. The intended replacement is MaybeUninit, which tracks the possibility of uninitialized values at the type level to make sure the compiler does not make any false assumptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions