rustc_lint::drop_forget_useless

Static UNDROPPED_MANUALLY_DROPS

source
pub static UNDROPPED_MANUALLY_DROPS: &Lint
Expand description

The undropped_manually_drops lint check for calls to std::mem::drop with a value of std::mem::ManuallyDrop which doesn’t drop.

§Example

struct S;
drop(std::mem::ManuallyDrop::new(S));

{{produces}}

§Explanation

ManuallyDrop does not drop it’s inner value so calling std::mem::drop will not drop the inner value of the ManuallyDrop either.