Skip to content

New lint: casting &mut T to &mut MaybeUninit<T> and exposing it as safe #4896

Open
@Kixunil

Description

@Kixunil

As discussed at several different places, the pattern of casting &mut T to &mut MaybeUninit<T> or &mut [T] to &mut [MaybeUninit<T>] and exposing it as safe is reoccurring (see bellow), so making Correctness lint would help.

IDK if there's any policy about clippy suggesting particular crates, but if this is allowed, maybe suggest possibly_uninit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-correctnessLint: Belongs in the correctness lint group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions