UNDROPPED_MANUALLY_DROPS in rustc_lint::drop_forget_useless - Rust
Description: The `undropped_manually_drops` lint check for calls to `std::mem::drop` with a value of `std::mem::ManuallyDrop` which doesn’t drop.

Skip to main content

## UNDROPPED_MANUALLY_DROPS

# 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.