RS.CLIPPY.DROP_NON_DROP

Call to `std::mem::drop` with a value which does not implement `Drop`

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: drop_non_drop. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for calls to std::mem::drop with a value that does not implement Drop.

Why is this bad?

Calling std::mem::drop is no different than dropping such a type. A different value may have been intended.

Example

struct Foo;
let x = Foo;
std::mem::drop(x);