]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/forget_non_drop.txt
:arrow_up: rust-analyzer
[rust.git] / src / tools / clippy / src / docs / forget_non_drop.txt
1 ### What it does
2 Checks for calls to `std::mem::forget` with a value that does not implement `Drop`.
3
4 ### Why is this bad?
5 Calling `std::mem::forget` is no different than dropping such a type. A different value may
6 have been intended.
7
8 ### Example
9 ```
10 struct Foo;
11 let x = Foo;
12 std::mem::forget(x);
13 ```