New lint: casting &mut T to &mut MaybeUninit<T> and exposing it as safe #4896
Labels
A-lint
Area: New lints
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
L-correctness
Lint: Belongs in the correctness lint group
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
.rust
bytes
is unsounduninit
crate is unsoundpossibly_uninit
was almost made unsound but I realized it and fixed it before it was too late. :)The text was updated successfully, but these errors were encountered: